LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read parameters from equipment with other protocol

Solved!
Go to solution
Highlighted

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!

0 Kudos
Message 1 of 19
(1,749 Views)
Highlighted

Hi,

 

        If the protocol implementation is developed in text based programming languages, a dll can be build and called in LabVIEW.

 

 

0 Kudos
Message 2 of 19
(1,738 Views)
Highlighted

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!

0 Kudos
Message 3 of 19
(1,727 Views)
Highlighted

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.


LabVIEW Champion, CLA, CLED, CTD
MediaMongrels Ltd. - NI Alliance Partner (blog)
0 Kudos
Message 4 of 19
(1,725 Views)
Highlighted

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!

0 Kudos
Message 5 of 19
(1,717 Views)
Highlighted

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.

0 Kudos
Message 6 of 19
(1,713 Views)
Highlighted

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!!

0 Kudos
Message 7 of 19
(1,710 Views)
Highlighted

Hello Marius,

 

                        Please find attached the image and the VI.

 

    

0 Kudos
Message 8 of 19
(1,702 Views)
Highlighted

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!

0 Kudos
Message 9 of 19
(1,690 Views)
Highlighted

Hy!!

There are someone who can help me to read this kind of protocol? 

Thanks a lot!

0 Kudos
Message 10 of 19
(1,638 Views)