10-24-2016 02:52 AM
Hello Everyone!
I want to ask you, if is possible to read parameters from an equipment with an "special" protocol. The protocol is 4-byte or 128 byte protocol and command consists of : STX(start of address - 1 byte) Recipiend address(2 bytes) Sender address(2 bytes) parameters numbers(2 bytes) parameter value(4 bytes/ 128 bytes) checkSum(1 byte, it is CRC) and EOT/ETX(end of text 1 byte).
Someone can tell me how can i access them? In the past i used Modbus routine .
Thank you so much!
Solved! Go to Solution.
10-24-2016 03:12 AM
Hi,
If the protocol implementation is developed in text based programming languages, a dll can be build and called in LabVIEW.
10-24-2016 03:48 AM
Hy Covelil!
In the file, is some description about protocol;(page 4-6)
What do you mean when you say a text language?
Thank you!
10-24-2016 03:51 AM
What is the communications port you are using? Serial, TCP/IP, UDP or something else?
Assuming it's Serial and therefore you would use NI-VISA, you can use the EOT/ETX character as the termination character. You can convert the string to an array of U8 (bytes) and then index out the bytes from the message.
10-24-2016 04:20 AM
I am using TCP/IP communication! with an IP and port connection. There are, in labview some example to use this kind of protocol, with STX, EOT?
The steps are: open the connection(by ip and port) then i will use the TCP-Read vi or some Visa VIs?
Thank you Sam!
10-24-2016 04:31 AM
Hi Marius,
You have to form your array of bytes (U8) using the protocol. convert the array of bytes to string using the byte array to string function. This String can be used with TCP Write to transmit.
During TCP Read, based on your protocol, identify the number of bytes which is expected, then convert the read string to array of bytes and decode each bytes using the protocol used.
10-24-2016 04:42 AM
Hy Kovelil!
I partial understood! But if you take a look in the file bellow, at the 7 page, there are the parameter numbers(where i compose what parameter i want to read). It is possible to read multiple parameters? Because, from the file, i think that i can read just 1 parameter(must to compose the command in HEX and before the EOT i must to calculate the CRC/CheckSum).
Tell me that i wrong, or if i don't understand what do you mean!
Thanks!!
10-24-2016 05:00 AM
Hello Marius,
Please find attached the image and the VI.
10-24-2016 05:41 AM
Hy Kovelil!
I saw your example, sorry that I don't understand you, but how the program can access some parameter, if, to access parameter is must have a string like that "02(STX) 12 8F(Dest) 00 00(source) 40 54(param numbers<<+read or write comand>>) 00 00 00 00(param Value) 97(CRC) 03(EOT) "- example for read parameter 84.
Now, i try some commands, like the command above with an "hercules Software". when i send a command, the equipment send me an answer who looks like the command: for example :
i send in HEX {02} {12}{8F} {00}{00} {40}{54} {00}{00}{00}{00} {89} {03}
i received in Hex: {02} {00}{00} {12}{8F} {00}{54} {00}{00}{00}{00} {C9} {03} (at the parameter 84 is 0).
From your example, i completed with some value(image bellow). That is what do you want to say?
Thank you for your time!
10-25-2016 03:20 AM
Hy!!
There are someone who can help me to read this kind of protocol?
Thanks a lot!