LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FP Write and VISA Serial Write on cFP-2120

Trying out some Fieldpoint usages.
 
I have an LV project.
 
In this project I have added Targets and Devices.
 
I created a new VI under My Computer
I created a new VI under the Compact Fieldpoint controller.
 
The VI under the local host does nothing but call the subVI that should run on the cFP-2120.
 
In the subVI we have a simple sequence that first performs an FP Write to an Analog Output module, then sends a string out on one of the serial ports of the 2120 using VISA Serial Write.
 
That's what SHOULD happen anyhow.
 
In reality, the value of the FP Write is set, but the serial write does not occur.
Instead I get an error stating that the resource is not valid.
"VISA:  (Hex 0xBFFF000E) The given session or object reference is invalid."
I have hard-coded COM2 as the resource value for the serial write.
 
What do I need to do to get the serial write to work on the 2120?
 
Here are the files in LV8.2
 
I've already checked to make sure that all the software in the RT matches the software on the host in MAX by version number.
 
 
Download All
0 Kudos
Message 1 of 11
(3,878 Views)
The first problem here is that you can't use a VI on your local computer to "call" a VI on the FieldPoint module.  VIs do not cross target boundaries.  If you execute a VI on a particular target, such as your local computer, every VI that it calls runs on the same target, so when you run "Test Local" as you have it set up right now, you're running Test Remote on the local computer too.  Try opening Test Remote from the project manager under your FieldPoint module, and note that in the lower left corner of the VI block diagram window it tells you which target will execute that VI when you run it.  Run the VI; it should download to the FieldPoint module and execute, and you can use the standard debugging tricks to look at it.

Note that the FieldPoint write succeeds even though your code is running on the local computer, because that's the way FieldPoint I/O works - it can be done transparently over the network from a host computer.  The VISA write doesn't work like that.  Eventually you'll probably need to design a way for the FieldPoint module to communicate with your host computer, using shared variables or raw TCP/IP, and there are many examples demonstrating how to do this.

Message Edited by nathand on 04-13-2007 11:50 AM

Message 2 of 11
(3,872 Views)

OK, I see.

I was able to get the Test Remote running on the RT and it is spitting out data on the RT com port.

Now then, what I seem to still be missing is the fashion in which to communicate the message string from the local computer to the RT.

The VI running on the RT should be constructed to lie dormant and wait for a string to be sent from the local host, then activate and write it out.

How does one do this?

 

0 Kudos
Message 3 of 11
(3,866 Views)
Take a look at the examples under Toolkits and Modules -> Real-Time -> Network Communication in the Example Finder, particularly "RT Network Communication.lvproj" which uses shared variables.
Message 4 of 11
(3,856 Views)
Thanks!
0 Kudos
Message 5 of 11
(3,856 Views)

Well, now I get this error:

Deploying FP @ 172_30_3_107  (successfully deployed target settings)
Deploying RT Network Communication.lvlib \\172.30.3.107\RT Network Communication deployment failed (error: -2147220717, (Hex 0x80040313) The Remote Procedure Call connecting the client to the configuration server failed to be initialized. Your installation may need to be repaired.).

 

0 Kudos
Message 6 of 11
(3,849 Views)

At least the code example is clear and simple.

 

0 Kudos
Message 7 of 11
(3,840 Views)
This is a guess, but make sure that the shared variable engine is installed on your cFP module.  You can do this in MAX: under remote systems, expand your FieldPoint module, right click on software, and choose Add/Remove Software.

Alternatively, if all you need to do is send a string once in a while, you may find that straight TCP/IP will work fine for your application.
Message 8 of 11
(3,835 Views)

That was the problem casuing the error alright.

Neither the Network Variable Engine nor the Variable Client Support were installed on the RT.

Now the software deploys with no error.

However, it doesn't run.

I receive no data on the host.

I have to click on the remote VI in the project and open it.

It isn't running, and I click the Run button.

Then data is received on the host VI.

I tried changing the Execution properties of the VI to Run when opened, but that didn't help.

We're real close here.

 

0 Kudos
Message 9 of 11
(3,828 Views)
That's the expected behavior.  The extra step is that you're deploying it - no need to do that.  Just open the VI on the cFP target and click run; it will download and start executing.  Deploy downloads the VIs without executing them.  Once your VI is running on the target you can right click on the target in the project explorer and choose "Disconnect" to leave it running without any front-panel communication; if you don't disconnect before closing the front panel it will stop executing.  Similarly you can connect to a disconnected target and it will attempt to load the front panel for the currently-running VI.  If you need your VI to execute when the FieldPoint module boots, you'll need to create a startup application.
0 Kudos
Message 10 of 11
(3,825 Views)