LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending timed files on command from cRIO to PC

I'm trying to send files from my cRIO device to my PC. The way I need it to work is I press a button/flick a switch and that indicates that the files need to be saved. I want the files to contain data from N amount of seconds before the button is pressed. Where N is given at the users discretion. I feel like I am over complicating it, because it seems like a pretty straightforward task.

 

Someone in another forum suggested using the lossy enqueue function, which I understand why, because it would only be storing values that I have requested. LabVIEW isn't my strong suite so what I am not understanding is how I would:

1) Create/set the queue's size to a time period

2) Send/Stream?/Transfer? the queue to a file on the PC

 

0 Kudos
Message 1 of 9
(4,264 Views)

I've found some post with people using arrays with time stamps for similar things, but I still don't know how I would get the last N amount of seconds.

0 Kudos
Message 2 of 9
(4,225 Views)

Hi atokad,

 

LabvIEW comes with several predefined example RealTime projects. All of them show how to transfer data between PC host ans RT target. Did you examine them?

 

You can also look for examples in the example finder. I suggest to play with those network stream examples…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 9
(4,208 Views)

I didn't see any examples that work the way I want the project to work

0 Kudos
Message 4 of 9
(4,199 Views)

This request is absolutely trivial if you figure out how to use;

 

A) a Lossy queue

B) VI Server Remote access

C) Action Engines

D) VI server call by reference

 

"elevator speech"

 

the cRIO continuously collect data and puts it in a lossy queues of the size required.

Init an action enigine that holds the queue reference.

Serve the Action using VI server to the PC.

The PC when it starts opens a ref to the app running on the cRIO and then a ref to the Action Engine mentioned above.

When the user clicks the button the Action Engine is invoked (that is running on the cRIO) via VI server call by reference node using a "Get data" action which uses the queue ref to get the entire queue contents and returns it via connector on the icon connector.

PLot the returned data.

 

Done!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 9
(4,192 Views)

I'm struggling to understand how to set the "size required" for the queue though

0 Kudos
Message 6 of 9
(4,180 Views)

When the queus is created use the "max queueu size" input to limit the size of the queue.

When applying updates to eh queue use the "lossy Enqueue Element".

As long as the # samples queue up each time you enqueue, the queue will fill to max size then only retain the most recent number of updates.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 9
(4,177 Views)

I want something like the VI attached, but where the the trigger sends data from the N seconds  before triggering instead of the next N seconds.

0 Kudos
Message 8 of 9
(4,176 Views)

@atokad wrote:

I want something like the VI attached, but where the the trigger sends data from the N seconds  before triggering instead of the next N seconds.


Yes that is what I outlined above. When you fetch from the queue you will get all of the data that has pilled up in the queue waiting for the user to start the transfer.

 

When you get around to VI server, look at the example;

 

C:\Program Files\National Instruments\LabVIEW 2017\examples\Application Control\VI Server\Exporting VIs\Exporting VIs.lvproj

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 9
(4,172 Views)