LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus read multiple regs array size always 9

Solved!
Go to solution

seems internally cluster is same as arrays. chain of numbers, the system has to know, which one is which. Array is more ordered. Cluster you can attach name tags. The code I am patching my SQL / Modbus in has all clusters, as for humans its easier, if there are name tags.

I guess for the modbus bit, say I read 8 values, can wire that constant to array. As in make array of 8. So that ties it all in. Then read all the splinters of modbus registers from PLC. Built array with concatenate function. Pass from cRio to PC host. Then pull apart at the other end.

0 Kudos
Message 11 of 21
(777 Views)

Hi Steffen,

 

seems internally cluster is same as arrays. chain of numbers,

Wrong!

A cluster can contain not just "numbers", but any datatype you like (strings, booleans, other arrays/clusters)!

 

Btw. by using ArrayToCluster you don't get a typedef'd cluster with "readable" element labels - you will need atleast one more step to reach your goal…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 21
(771 Views)

RavensFan ha scritto:In the meantime, you asked a question about why the Array to Cluster function is always 9, and tyk009 gave you the solution on how to change that to another value.  So go ahead, give him a Kudo, and mark his message #2 as the solution to your question.

 


It seems that tyk009 (the default) was reconfigured to be tyk007. Smiley LOL

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 13 of 21
(767 Views)

yes, I have to make a cluster, name each indicator. Lots of naming there. Then make a typedif.

Turns out the register map will change completely soon, I need 2 setups. Seems then arrays are better then anyway

0 Kudos
Message 14 of 21
(763 Views)

attached should it sorted. Key in csv file.

the old modbus register is by property, the new regiser is by motor number, completely reshuffled. So if I pack all the relevant values into anarrey and then switch the key, anything else could be the same vis. Displays, SQL.....

0 Kudos
Message 15 of 21
(754 Views)

and with any luck the key could rever to the modbus register number

0 Kudos
Message 16 of 21
(758 Views)

Smiley Very Happy  Yeah, I think the number 9 being part of the title and the point of the thread got stuck in my head.

Message 17 of 21
(748 Views)

yes, the default in cluster constant is 9.

I can put that to bad use. One modbus register has 250, the other 350. So I could make an array with 350, for the 250 concatenate all the reads to 250 say, make cluster constant of 100, change to array. That concatenates to 350 array. Then on the PC end I always get a 350 array and use the key vi I posted earlier.

Old map is say M1a, M2a, M3a......M1b,M2b.... new one is M1a,M1b...M1h. then 10 empty, Then M2a,M2b,,, thats whys its 350 instead 250 values.

 

0 Kudos
Message 18 of 21
(738 Views)

Hi Steffen,

 

your messages are hard to read/understand. Maybe it would be easier to write in the German forum?

 

When you want to keep key-value pairs you should have a look at variant attributes!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 19 of 21
(728 Views)

pretty quiet there.

And I guess I cannot post our Modbus register list as an example.

0 Kudos
Message 20 of 21
(725 Views)