LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a .csv when using a Real-Time Module

Solved!
Go to solution

Hi All,

 

I'm using LabVIEW 2018 with FPGA Module and Real-Time Module.

 

I'm trying to execute a very simple task of creating a .csv file in a folder on the Desktop.

 

SDuffyLV_0-1622806850336.png

 

 

When using the Real-Time Module, this doesn't work. No errors show in the Error Out.

 

I'm assuming with it using the Real-Time Module that the Path name must be written differently to normal.

 

If this is the case, then is there any simple way to change the Path generated from "Path->Browse Options->Selection Mode->Files or Folders" (e.g. SDuffyLV_1-1622807090819.png) to the new Path for Real-Time Modules? 

0 Kudos
Message 1 of 6
(2,202 Views)
Solution
Accepted by SDuffyLV

The RT system cannot write to your desktop.  It is a separate computer.  You need to choose a folder location on the RT system and then use WebDAV to get the data off.  Alternatively, you can have the RT system write to an application or VI with TCP on the Windows system.  The Windows application/VI can then write that data to the file.


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
Message 2 of 6
(2,192 Views)
Solution
Accepted by SDuffyLV

I've figured out a workaround for the problem.

 

Simply, create this VI in the "My Computer" part of the Project Explorer, not the "NI-PXIe" (or similar RT) folder.

 

If you want to write data from the RT to the VI (or text file you create using the VI), then:

1) Create a Global Variable in the .lvlib of the RT folder

2) Place the Global Variable in the RT VI

3) Connect the data (in my case, a 2D Array) to the Global Variable in the RT VI

4) Place the Global Variable in the "My Computer" VI

5) Connect as you wish

0 Kudos
Message 3 of 6
(2,154 Views)

Hi SDuffy,

 


@SDuffyLV wrote:

I've figured out a workaround for the problem.

Simply, create this VI in the "My Computer" part of the Project Explorer, not the "NI-PXIe" (or similar RT) folder.

If you want to write data from the RT to the VI (or text file you create using the VI), then:

1) Create a Global Variable in the .lvlib of the RT folder

2) Place the Global Variable in the RT VI

3) Connect the data (in my case, a 2D Array) to the Global Variable in the RT VI

4) Place the Global Variable in the "My Computer" VI

5) Connect as you wish


I'm sure this "workaround" results in errors/problems. It certainly is no solution…

Your host computer has no access to the global variable on your RT executable!

 

LabVIEW comes with a huge example library, and there are also example projects explaining how to transfer data from FPGA to RT to host computer!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,139 Views)

Hi GerdW,

 

Maybe for other scenarios this solution may not work but it has done in this case.

 

There was no issue reading from the Waveform Capture.vi in the NI-PXIe folder via a Global Variable.

 

If it was from the FPGA Target folder that is inside the NI-PXIe folder then I'd understand there could be a problem there.

 

Is it possible I've asked the wrong question?

 

I'll give the Accept Solution to crossrulz regardless as I'm sure this would be a solution to the issue in the scenario that he likely understood the question as.

0 Kudos
Message 5 of 6
(2,128 Views)

Hi SDuffy,

 


@SDuffyLV wrote:

Maybe for other scenarios this solution may not work but it has done in this case.

There was no issue reading from the Waveform Capture.vi in the NI-PXIe folder via a Global Variable.

If it was from the FPGA Target folder that is inside the NI-PXIe folder then I'd understand there could be a problem there.


A global variable is only accessable in the context of the executable holding that global. When the RTEXE holds the global, then your (Windows) host computer executable has no access to that global of the RTEXE…

(It might work, when you run all VIs from within the LabVIEW IDE. I don't recommend that for a production system.)

(It might also work, when you refer to SharedVariables instead of global variables.)

 


@SDuffyLV wrote:

I'll give the Accept Solution to crossrulz regardless as I'm sure this would be a solution to the issue in the scenario that he likely understood the question as.


That is ok.

My suggestion basically is the same, as the mentioned example projects also show how to use network communication to transfer data between your different targets!

Best regards,
GerdW


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