02-18-2021 02:02 AM
Hello:
Actually I am receiving data from the FPGA and queueing.
I must transform all the data to string to send to the socket TCP.
In the first picture, we see a qeueing reading and a decimate of the data because it is 4 channel data.
The i pass this decimated arrays to a string converted subvi
This string converter subvi, takes the 4 inputs arrays and transform each individual value and attached the characters AvalueABvalueBCvalueCDvalueD
But it seems that the queue reading is faster than the transform to string.
Is it anyway to make the transformation faster .
I think that i have a funnel between the transformation and the socket writing
Solved! Go to Solution.
02-18-2021 02:23 AM - edited 02-18-2021 02:26 AM
Hi GuilleCad,
@GuilleCad wrote:
Is it anyway to make the transformation faster .
Try this:

No need to decimate the whole array and to create 4 sub-arrays.
No need to multiply each individual element with its own multplication node when you can apply the scaling to your whole array.
No need to init a string array to replace all elements when you can use autoindexing.
Btw. do you really need this way of encoding the data? Wouldn't it be much simpler to use a standard "%.;%f,%f,%f,%f\r\n" format string to allow operations like ArrayToSpreadsheetString/SpreadsheetStringToArray?
02-18-2021 08:42 AM
@GuilleCad wrote:
Is it anyway to make the transformation faster .
Depending on the receiver, I would probably just use Flatten To String. On the receive side, read 4 bytes (I32 for the number of elements in the array), multiply by 8 to get the number of bytes in the array (8 bytes per element), read that many bytes, and then Unflatten From String to convert back to the double array.
02-24-2021 03:03 AM
Thanks for the suggestion.
I am going to try it.
Probably the second suggestion that you made would be much simplier, but in the other side of the TCP connection is a python script where I have created 4 list for each encapsulated data, because each data belongs to a specific channel
02-24-2021 06:29 AM
Hi GerdW
I have try your suggestion and it works much faster!
Thank you.
But on the other side now I have receiving some data empty or only the sign
In the previous version I have never have this kind of error, could i assume that is because now is faster and ignore some value?
Should I reduce the time loop period? Now is in 10us should I execute in 100 us or 1 ms?