11-22-2017 12:10 AM
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.
11-22-2017 01:19 AM
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…
11-22-2017 02:13 AM
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.
11-22-2017 03:35 AM
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
11-22-2017 06:13 AM
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.....
11-22-2017 06:19 AM
and with any luck the key could rever to the modbus register number
11-22-2017 08:59 AM
Yeah, I think the number 9 being part of the title and the point of the thread got stuck in my head.
11-22-2017 02:48 PM
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.
11-22-2017 03:58 PM
11-22-2017 04:00 PM - edited 11-22-2017 04:00 PM
pretty quiet there.
And I guess I cannot post our Modbus register list as an example.