LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build array from random values via ethernet

Am trying to save data that comes from ehternet ((random values (modbus protocol)) in an array.
I am using an index array.....but all the values are the same!! How can I sort them??
 
It functions correctly with a for loop with random numbers build.......but it doesn't work with the data from ethernet.
Can someone please help me??
0 Kudos
Message 1 of 4
(2,933 Views)


@chendel wrote:
Am trying to save data that comes from ehternet ((random values (modbus protocol)) in an array.
I am using an index array.....but all the values are the same!!
You just read the same shared variable 100 times within a few nanoseconds. Apparently, the variable gets modified less often on the other end.


@chendel wrote:
How can I sort them??

If all array values are the same, they are already sorted. 😉

You need to rethink your code. maybe you can make the shared variable an array and write the entire random array on the other end, the read it out once.

0 Kudos
Message 2 of 4
(2,918 Views)

Ohh ok. But the signal entered change constantly. That's why i am trying to save all those data.

By making the input an array, it gives me an error. That's why I can not continue.

0 Kudos
Message 3 of 4
(2,915 Views)

Hello chendel,

When you are defining the properties for the shared variable make sure that you are defining the data type as "Array of double" or something similar for your application. Look at the attached screenshot for for information.

Regards,

Chetan K

Application Engineering

NI

 

0 Kudos
Message 4 of 4
(2,881 Views)