Re: Protocol j1587
Posted: Tue Jan 23, 2024 9:13 am
Hi,
Something dawned on me last night, you have not said how you are trying to implement this. You made a comment
I am not sure quite what you mean by that but have you decided on a device which will run FC.
I think a microcontroller would be ideal as you can read the serial data into that, looking at your screenshots all the data is 3 characters so that should be easy to migrate to a numeric array usind left$, mid$ as Chipfryer suggested. From there you can have several macro's (one for each MID) and in the macro parse the array, you can ignore position 0 as that has already decided which macro you are in. Read array pos 1 and decide if the data is 1 or 2 bytes and then read the respective elements and calculate the data. Also increment a pointer for the next element of the array to read so in your original data example 084 is one byte so the pointer would then be 3 for the next calculation and then 190 is 2 bytes of data so the pointer would be 6 and so on.
I do have a project that reads data from a string and seperates it like what I think you need so I will have a look to see if I can modify it to give you a bit of a start.
Bob
Something dawned on me last night, you have not said how you are trying to implement this. You made a comment
.I can't connect external COM to FC, I think it would be easier that way
I am not sure quite what you mean by that but have you decided on a device which will run FC.
I think a microcontroller would be ideal as you can read the serial data into that, looking at your screenshots all the data is 3 characters so that should be easy to migrate to a numeric array usind left$, mid$ as Chipfryer suggested. From there you can have several macro's (one for each MID) and in the macro parse the array, you can ignore position 0 as that has already decided which macro you are in. Read array pos 1 and decide if the data is 1 or 2 bytes and then read the respective elements and calculate the data. Also increment a pointer for the next element of the array to read so in your original data example 084 is one byte so the pointer would then be 3 for the next calculation and then 190 is 2 bytes of data so the pointer would be 6 and so on.
I do have a project that reads data from a string and seperates it like what I think you need so I will have a look to see if I can modify it to give you a bit of a start.
Bob