Sergio Ramos Posted March 8, 2022 Report Share Posted March 8, 2022 Hello! If anyone has any experience or any examples of using the SAEJ1939 Protocol, I would really appreciate some help. I am using a NOx sensor and would like to extract its data to an HMI. I am currently trying to figure out how to utilize the parameters of the J1939 Protocol. I have the values of the Protocol from the user manual but I do not know how to interpret it for the Visilogic Function blocks. For example, to extract the NOx value would I say there are 2 bytes of max data allowed? (Since there a low and high bytes). And for data pointers, does it "point" to the address of a byte or a bit? Also, once the data is received, where would it be stored? And how can I convert it to a readable value? Would I have to convert it from a BIT to a NUM eight times (Since I get a bit of information and not a byte)? I would really appreciate any thought or comments. I have attached the manual, some screenshots, and my program so far. Thanks again. trial j1939.vlp Conti UniNOx12V_spec_11 03 08 (1).pdf Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted March 8, 2022 MVP 2023 Report Share Posted March 8, 2022 I try to check your code... I recommend to start new project with basic J1939 function. I think you find this sample code and understand idea how to convert MI vector to separate MI and MB. 1 Link to comment Share on other sites More sharing options...
Sergio Ramos Posted March 8, 2022 Author Report Share Posted March 8, 2022 Hello, so for that code, it would make an array of all the bits of the J1939 Protocol. Would it be correct to assume that I could convert that array into a a readable number by the function BIT to NUM? And also, I think I figured something out, from what you said. The bit array will start say, on MB 1000, as the example, therefore the first 8 bits would be on MB 1000-10007. So if I needed the first 8 bits only, would it look something like this? The formula at the end is to convert the NOx value into ppm (parts per million). I once again thank you for your help! J1939 TRIAL V2.vlp Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted March 9, 2022 MVP 2023 Report Share Posted March 9, 2022 20 hours ago, Sergio Ramos said: The bit array will start say, on MB 1000, as the example, therefore the first 8 bits would be on MB 1000-10007. So if I needed the first 8 bits only, would it look something like this? Yes, Visilogic have all needed FB for convertion. One thing that you must do - find the way to test - is it reading from sensor correct. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now