From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial port resource name on FP controller

Hi all,
 
I am currently using Labview 7.1. I have a question regarding how to access to the serial port on a compact field point controller and would like some expert suggestions.
 
I have a pressure sensor that has a serial port for sending data. When I connect it to a PC and run the "advanced serial write.vi" with the right parameters, I can obtain the correct pressure reading. Now, I want to connect this pressure sensor to the serial port on my field point controller and run a program on my PC. I have tried several ways and it seems to me that I have to target my Labview to my controller address first before running the VI in order to record the pressure.
 
I would like to know if there is a way that I can create a "tag" (as if the tag name for referring to other modules on the controller) that is corresponding to the serial port on my cFP-2015 controller, so that I can run a program on my PC to record pressure data via the serial port on my controller.
 
 
tak
0 Kudos
Message 1 of 5
(2,359 Views)

Hello Tak,

In order for a LabVIEW application to access the serial port on the FieldPoint controller, the vi must be running on the FieldPoint controller.  This means targeting the controller, as you have already tried.  You can find more information on this here.  If you want to read data on your FieldPoint controller through RS-232 and record it on your PC, you could read in the data with an embedded VI and send it back to another VI running on your computer.  This could be done by using TCP or DataSocket.

There are many examples in NI Example finder for both TCP and DataSocket communication.

Regards,

Jesse O.
Applications Engineering
National Instruments



Jesse O. | National Instruments R&D
0 Kudos
Message 2 of 5
(2,341 Views)
Hi Jesse,

Thank you for the clarification.

I wonder if I can ask you another question regarding saving data on my cFP controller.

My current program has a while loop that continuously read the values from my controllers and then save them on a text file. When I run this program on a PC, the data files are saved on the local PC in the default data folder. When I embed this program and run it on the controller, it seems to be able to generate the files and save it in the LABVIEW DATA folder on my controller. However, it seems that it is only capable of saving for one cycle, and then it stop from saving anything. However, I am sure my program is run to completion. Do you happen to know what I may have done wrong?? Thanks.


tak
0 Kudos
Message 3 of 5
(2,338 Views)

Tak,

When writing data to the FieldPoint controller it should allow you to append to a file instead of just overwriting it.  You do not mention how you are writing the file, but based on what you described, I assume that you are using the LabVIEW Write Measurement File Express VI.  This VI by default will save to the LabVIEW Data folder on the controller.  I have tested this, and I was able to write several iterations to the file and append correctly.  I would verify that when you target your controller that the file settings are correct.  You might want to change some of the settings, perhaps the filename, to insure that your program is updating the values when operating on the controller.

If you are using the Express VI to write your data please make sure that under the 'If file already exists?' that ‘Append to file’ is selected.  You might want to set the header option to 'One header only'.

If this does not work for you, you can always try using the file I/O options under the File I/O palette.  There are examples in example finder that show how to use these VIs.

Regards,

Jesse O.
Applications Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 4 of 5
(2,321 Views)

Hi Jesse,

Thanks for the clarification. I will double check my program. Thanks for your suggestions.

tak

0 Kudos
Message 5 of 5
(2,311 Views)