LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data from cRIO 9076 to PC

Hello,

 

I am using serial port of cRIO for input. I need to save the input data in my PC in a text file. Can someone please tell me how can I do that?

 

I tried using VISA read, write to do that, but could not succeed.

0 Kudos
Message 1 of 18
(5,335 Views)

Hi nehap,

 

LabVIEW comes with a lot of example VIs and projects, explaining most stuff…

 

Can someone please tell me how can I do that?

Did you try any of those RT examples projects? They explain how to transfer data from RIO to host PC!

 

I need to save the input data in my PC in a text file. I tried using VISA read, write to do that, but could not succeed.

Again I have to ask (as I did here😞

What have you tried?

Do you get error messages?

Which file path did you try?

Can you attach your VI (with meaningful default data in the controls)?

 

Btw. saving data to files is not related to GPIB or VISA, so I moved your message from hardware related board to LabVIEW board!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(5,329 Views)

to get data from RT to PC, you can either use Network Shared Variables, from which you read on the PC, or you use Network Streams which is more involved.

 

have a look at these links

http://zone.ni.com/reference/en-XX/help/371361N-01/lvconcepts/data_comm/

http://zone.ni.com/reference/en-XX/help/370622N-01/lvrtbestpractices/rt_gui_bp/


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 3 of 18
(5,304 Views)

Use a Network Stream to send your VISA Read data on the cRIO to your PC.  On the PC, you can then read from the Network Stream and save that data to a file.  But you will need multiple applications to do this (one on the cRIO and one on the PC).  There are plenty of examples in the Example Finder (Help->Find Examples) for how to do each part of this process.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 18
(5,302 Views)

Sorry for late reply.

pl see the VI attached.

 

 

Also, pl tell me whether to use RT-FIFO for saving the RT data from cRIO to host PC?

0 Kudos
Message 5 of 18
(5,257 Views)

Hi nehap,

 

tell me whether to use RT-FIFO for saving the RT data from cRIO to host PC?

No, the RT-FIFO only works "inside" the RT!

As has been suggested before: use network streams (or other network communication schemes)!

 

pl see the VI attached.

- you can resize the IndexArray node so you only need one of them

- what's the point of putting the PID inside this TimedWhileLoop?

- why did you delete the label of the stop button? NEVER do that again!

- as you didn't set any default values you still don't say the file path you are trying to save your data to…

- there is no error handling at the FileOpen function!

- do you think you can go the those default PID gain values?

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 18
(5,249 Views)

Thank you for the reply.

 

- what's the point of putting the PID inside this TimedWhileLoop?

 I wanted a continuos data in the output, so i thought of putting PID in the same loop as that of the data input. Is it a wrong way to use it?

 

- as you didn't set any default values you still don't say the file path you are trying to save your data to…

I didnt get this point, can u pl ellaborate?

 

- do you think you can go the those default PID gain values?

I was trying to manually tune the gain values which I obtained from a simulation in simulink.

 

I have some more doubts,

1. I tried to use FTP to save data to the host PC? Is it right?

 

2. Is there any way by which I can save cRIO output data?

0 Kudos
Message 7 of 18
(5,239 Views)

i think GerdW did not show you the correct version, only a cleaned up and simplified version of your code,

which is appreciated if you ask for input to clean up your vi.  (EDIT: but you could do it that way too, depends on time criticality)

 

the default values are values you put into your controls and then Edit->Save Current Values As Default,

which lets ppl see what your input values are (like the path for example)

 

use a network stream to transfer data from crio to pc and another network stream to transfer data from pc to crio.

use either a state machine or a producer-consumer design pattern.

 

 

 

your last two questions:

yes you can use s-/ftp/webdav do get data off your cRIO, but that means you have to log locally on the cRIO and depending on how much data you are acquiring, the space may not be sufficient

 

what do you mean by cRIO output data? like errors or measurement data?

 

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 8 of 18
(5,232 Views)

Thank you for the inputs.

 

I am now reading about how to use FTP. For time being, I am directly saving the data through USB.

 

what do you mean by cRIO output data? like errors or measurement data?

Sorry for the confusion. I wanted to ask about the output measurement data from PID block. Can I save the data?

0 Kudos
Message 9 of 18
(5,227 Views)

accessing data via s-/ftp/webdav is nothing you do from inside a VI!

 

of course you can save your data, you just have to build something that writes your data to a file.

 

if you want to build a standalone application on the crio that is controlled by a "gui" app on the pc, you need to use the network streams!

and regardless you need a proper architecture, read up on producer-consumer design pattern


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 10 of 18
(5,224 Views)