LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing data in binary mode to MELSEC iQ-F series PLC

I'm trying to write data in batch mode to Mitsubishi FX5 PLC using the MELSEC protocol in binary mode (Example on page 77 of the digital document). The problem is that the data frame is built in a manner that uses only a single digit of the hexadecimal number for each device (0 to F instead of 0 to FF). For instance, if I want to turn on two devices I should send the command 11H, if I want to turn off the second device I should send the command as 10H. It is that simple, but I'm struggling because I have 6 devices and I need to do it dinamically according to what the user is selecting. When I take the boolean array from the user interface and try to convert to hex Labview assembles it like this example: [F,T,F,T,F,T] turns into 00 01 00 01 00 01. But I should write the TCP data string like this: 010101. I'm stuck and the only solution I can now think is grouping and setting each pair of devices to assemble the string. Any help or comment is very appreciated.

FBro_0-1767206071608.png

Thanks and Happy New Year!

 

Download All
0 Kudos
Message 1 of 4
(182 Views)

Here is the only solution (not elegant) I could find so far.

0 Kudos
Message 2 of 4
(174 Views)

Hi FBro,

 

unfortunately I cannot open your LV2025 VI.

Next time please downconvert for LV2021 or older. (I prefer LV2019.)

 

From your description I guess you want to do something like this:

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(109 Views)

After that I would still need to convert it to a string to send via TCP, but that would definitely work, yes! Thank you very much, indeed it looks a much more elegant solution.

 

I included the previous solution in the 2021 version.

0 Kudos
Message 4 of 4
(66 Views)