FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to send a 2D text array from a Labview progarm

Is it possible to send a 2D text array from my LV program running on my PC to a LV program running in Realtime on my FP2010 Processor?
 
When I tried to build the RT program using the wizard, it didn't find the array and add it to the "Indicator List:".  When I changed the array to a control, it didn't show up in the "Control List:"  I tried it with TCP/IP, UDP, DataSocket, and Logos.
 
If it's possible, then how is it done?
 
Using LV7.0 Pro on Win2K
 
Thanks,
Mike
 
 
0 Kudos
Message 1 of 8
(4,505 Views)

Hello Mike,

                   Thank you for contacting National Instruments. 2D arrays are not supported by RT FIFO's. Please refer the following links - The first link explains what data types are not supported and has a couple of tutorials explaining how to use LabVIEW RT Communication wizard. The second link explains how to share strings using RT FIFOs. Hope this helps.

Regards,

RMM

http://digital.ni.com/public.nsf/websearch/2478C5CCC53E460186256D63003DE388?OpenDocument

http://digital.ni.com/public.nsf/websearch/4C0DD3F01279A34286256F86007F031A?OpenDocument

0 Kudos
Message 2 of 8
(4,489 Views)
RMM,
 
Thanks for the reply.
 
I guess I could break the 2D array up into 26 x 1D arrays and pass them, but because not every element will contain data every time, as the 2D arrays differ, it would take some extra code to put it all back together.  The up side is that the array would only need to be passed in about once every 10 minutes.
 
Would it be possible for me to FTP the array from my hard drive (using LV) to the FP2010, where my FP RT program would be able to read it as a file?
 
Mike
 
 
 
 
0 Kudos
Message 3 of 8
(4,480 Views)

If you are already going that route, you're probably better off doing it inside LV.

There are several examples (and tutorials on this site. Search for "TCP tutorial" or "TCP fieldpoint") which show how to work with TCP between a PC and a FP. You can have a loop which will pass the data from the PC to the FP either by flattening it to a string or by using datasocket. This would definitely be better than going the FTP way.


___________________
Try to take over the world!
0 Kudos
Message 4 of 8
(4,469 Views)
TST,
 

Thanks for the response, but does it mean I don't have to flatten the array to a string if I use a datasocket?

I guess I should explain the application. I have a two loops that run in the PC. One that does ethernet to a scope & DMM, and another loop that does ethernet to my Fieldpoint rack where I control about 8 inputs & 50 outputs. The outputs are set from a 2D array that starts out as an Excel spreadsheet table. Performance is O.K., but I was hoping to get the Fieldpoint I/O to update a little faster by moving the FP loop from the PC to the FP controller. The only stumbling block is getting this Excel table in there.

Flattening it and then rebuilding it would be tricky, because I can't be sure that there would be an element in every cell, every time. I don't have to transfer the Excel table often - only at the beginning of each product tested - about once every 10 minutes. That's why I was hoping to transfer it in intact.

That's why I was thinking that I could have the LV program in my PC FTP the Excel spreadsheet into the "C:\" space of my FP2010, then the read spreadsheet vi I'm using now in the PC would run in the FP2010 and grab the table.

Thanks again,
Mike
 
 
0 Kudos
Message 5 of 8
(4,462 Views)

The good thing about DS is that it is transparent. You set something to publish in one place and you subscribe to it in another place. No need to handle the communication. The downside is that since you have less control.

As for the other method, flattening to a string (using the flatten function from the Advanced>>Data manipulation palette) does not cause any change in the data. When you unflatten the data, you simply need to supply the correct data type (in this case, probably a 2D DBL array) and you get the original data.

Look at the examples - for example, simple data server\client. It uses typecast instead of flattening, but that's irrelevant. Look at how it passes the data - first it sends the string length, then the rest of the string. On the other side, it reads the string length and uses that data to read the string and convert it back to the original data type - no data lost.

If you want it to be perfectly reliable, you should also have some means of periodically checking to see that the connection is still alive, and if it isn't (let's say a mouse ate the cable), close it and reopen.


___________________
Try to take over the world!
0 Kudos
Message 6 of 8
(4,460 Views)

Tst,

Thanks for the response.

Another question along the same lines.  From what I understood from your previous post, in one EXE I've built I can read the spreadsheet data into an array and then flatten the array into a string (using Flatten to String.vi), and then datasocket it to another EXE that I've built and turn it back into the spreadsheet array (using Unflatten from String.vi)?  Is there a size limit to the amount of data I can transfer in that flattened string through the datasocket?  (My spreadsheet is 256 rows x 26 columns, with a mix of mostly text and some FP values)

Thanks in advance for your advice,

Mike    

 

0 Kudos
Message 7 of 8
(4,355 Views)
There is no size limit for the size of the array that you can send over the network (other than the size limit for all arrays: 2^32 elements per dimensions) When transfering over the network, your bottle neck could be the bandwidth of the network itself. If you are not close to the max bandwidth, then I'd say that is should be ok for you to transfer large arrays.
 
 
Jack J.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 8
(4,328 Views)