Discussion:
How do two fieldpoints with embedded VIs communicate with each other?
(too old to reply)
Gizmaa
2008-08-08 17:10:05 UTC
Permalink
How do I get two fieldpoints to communicate with each other?  I need cFP-2120's to communicate with other cFP-2120's and cFP-1808's all with embedded VIs. My Setup:cFP-2120Software Installed     DataSocket for LabVIEW Real-Time 4.4     Fieldpoint Drivers 6.0.0     Fieldpiont VI Manager 6.0.1     LabVIEW Real-Time 8.2.1     NI-Serial RT 3.3.2     NI-VISA 4.3     NI-Watchdog 2.1.5Modules     cFP-TC-120     cFP-AI-112     cFP-PWM-520cFP-1808
Gizmaa
2008-08-08 20:40:05 UTC
Permalink
I was able to get the Datasocket method working.  It is a very slow method though.  I didn't check the exact run time but it was perceptible.  Are there any fast methods?  I will eventually need to collect a lot of data from a cFP-1808 and store/manipulate it in a cFP-2120. An image and the VI are attached.


FP2FP_1.jpg:
Loading Image...


FP2FP.vi:
http://forums.ni.com/attachments/ni/170/347975/2/FP2FP.vi
Ben
2008-08-09 14:10:05 UTC
Permalink
I'd advise an upgrade. The FP code from early version sof LV 8 has issues with the CPU being dominated by background processes.
Ben
Kevin_S
2008-08-11 16:10:08 UTC
Permalink
Hi Gizmaa,
You could use network-published variables along with this article (<a href="http://digital.ni.com/public.nsf/allkb/FA610367EC62574186257118005089F2?OpenDocument" target="_blank">Methods for Binding a Shared Variable to a FieldPoint Channel</a> ) in order to access different channels.
Also, you could try using a TCP/IP connection since the Shared Variables are built upon this.&nbsp; Using TCP/IP directly will allow you to communicate faster than through the use of Shared Variables.
I hope this helps,Kevin S.Applications EngineerNational Instruments
Gizmaa
2008-08-11 15:40:07 UTC
Permalink
Are there any other functions that can query blocks from on a cFP-1808 from a cFP-2120 using compiled programs and no computer in the middle?&nbsp; The other functions I've seen require some server function listening for a command. Is there a way to use TCP or UDP to query modules on a cFP-1808?
Gizmaa
2008-08-12 18:10:06 UTC
Permalink
I tried the first method outlined in the link you provided but I keep getting an error with the network-shared variable.&nbsp; It returns a 0, an error code of -1950679034, and a source of ni_tagger_lv_Read.&nbsp; A search of NI showed that this is likely due to a value not being received.&nbsp; The variable information is correct since it's visible and updating in the Variable Manager. What am I doing wrong?Attached are my project files.


test3.lvlib:
http://forums.ni.com/attachments/ni/170/348736/1/test3.lvlib


Cross_Test.lvproj:
http://forums.ni.com/attachments/ni/170/348736/2/Cross_Test.lvproj


FP2FP_3.vi:
http://forums.ni.com/attachments/ni/170/348736/3/FP2FP_3.vi
nathand
2008-08-13 13:40:09 UTC
Permalink
Perhaps I'm misunderstanding you, but you can do a FieldPoint Read of a remote module exactly the same way you read data from a local module.&nbsp; The FieldPoint resource name includes the name of the controlling module, so you can have code running on one 2120 that reads from several other remote FieldPoint units using the standard FieldPoint Read function.&nbsp; I've done this and it works fine.
Gizmaa
2008-08-13 14:40:08 UTC
Permalink
I have tried using the standard Fieldpoint Read/write functions but when I embed the program on a cFP-2120 the remote FP read/write functions do not work.
nathand
2008-08-13 14:40:09 UTC
Permalink
When you say &quot;do not work&quot; what error are you getting?&nbsp; You probably need to make sure that the right IAK file (FieldPoint configuration) describing all of your FieldPoint modules is properly deployed to the FP-2120.&nbsp; Unfortunately I can't give you an exact procedure as I no longer have any FieldPoint modules available, but I've done this in compiled applications and it worked as expected.
Gizmaa
2008-08-13 17:40:06 UTC
Permalink
I tried using the FP Open vi with only half success.&nbsp; It worked on my computer but when I embedded it it did not do what it was intended to do.&nbsp; The script I created checks the temperature of a thermocouple on a cFP-1808.&nbsp; Depending on the temperature it lights a certain amount of LEDs.&nbsp; When run from the project setup it returned the error &quot; The specified tag name was not found. : FP Create Tag .vi&quot;, error code of 32812.&nbsp; The .iak file was put in the root directory of the FP (C:\Mesocosm-01.iak).&nbsp; When run on the computer I correct the .iak file location. &nbsp;Attached are the necessary files.


FP_Test.zip:
http://forums.ni.com/ni/attachments/ni/170/349059/1/FP_Test.zip
nathand
2008-08-13 17:40:08 UTC
Permalink
You should not need FP Open at all, nor FP Create Tag - just use FieldPoint IO Points (as you're already doing for the LED outputs).&nbsp; I don't currently have the RT module nor FieldPoint installed on my machine so I can't fully open your project, but you probably need a FieldPoint configuration file (.iak) that matches the project name and is tied to the project.&nbsp; Then when you &quot;Deploy All&quot; to your target it should copy over the IAK file as well.
Gizmaa
2008-08-14 17:40:06 UTC
Permalink
I've tried everything I could possibly think of for the FP I/O.&nbsp; Attached are some images of my project, realtime startup vi properties, and the circuit diagram.&nbsp;Mesocosm-05 is the host, 192.168.1.164Mesocosm-01 is remote, 192.168.1.160&nbsp;When embedded the program is suppose to turn an LED on for 60 seconds on both Mesocosm-05 and Mesocosm-01 however when it is actually run only the LED on Mesocosm-05 activates.


Project.jpg:
Loading Image...


RT_Properties.jpg:
Loading Image...


SimpleTest.jpg:
Loading Image...
nathand
2008-08-14 17:40:08 UTC
Permalink
You need to add the second FieldPoint module to your project.&nbsp;Also, check that there's another iak file in the same folder as your lvproj, with the same name as the project.&nbsp; If so, that's the iak file that's tied to the project and is deployed to the FieldPoint units.&nbsp; (If there isn't, try creating a new project, then add both FieldPoint units and your VI to it.)&nbsp; You can remove &quot;Mesocosm-01.iak&quot; from your project; you don't need it and it's probably just creating additional confusion.Message Edited by nathand on 08-14-2008 01:38 PM
Gizmaa
2008-08-14 18:10:07 UTC
Permalink
I removed Mesocosm-01.iak from the project and added Mesocosm-01 (the controller) to the project.&nbsp; Afterwards I checked out the .iak file in the project directory and it showed both Mesocosm-01 and Mesocosm-05 only.&nbsp; The VI works if I run it from the project.&nbsp; It deploys and everything is as it should be but when I deploy it as a startup the remote controller doesn't do anything.&nbsp;


Project2.jpg:
Loading Image...
nathand
2008-08-14 18:40:05 UTC
Permalink
You've probably done this already, but make sure you do &quot;Deploy All&quot; on the FieldPoint target to download the module configuration... other than that I don't have any more ideas.&nbsp; Can you find out what the error is when you run the compiled application?
Gizmaa
2008-08-14 18:40:06 UTC
Permalink
No luck.&nbsp; How would I go about determining the errors after deployment?&nbsp;By the way, thanks for the prompt replies.&nbsp; I really appreciate it.
nathand
2008-08-14 18:40:07 UTC
Permalink
One approach would be to use remote front panels... but I haven't taken the time to figure out how that works with FieldPoint targets.&nbsp;A quick solution is to format the error into a string, write it to a temporary text file, and copy it off the FieldPoint module after the VI runs.&nbsp; Just make sure you don't chain the error output from the FieldPoint Write to the error input on the Write to Text File.&nbsp;EDIT&nbsp; One other idea: have you tried writing to a digital output on one of your IO modules, rather than the onboard LEDs of the remote module?&nbsp; Perhaps the LEDs aren't accessible remotely but other IO points are; I've never tried triggering the LEDs from a remote unit the way you're doing.Message Edited by nathand on 08-14-2008 02:34 PM
Gizmaa
2008-08-14 20:10:08 UTC
Permalink
Writing to a file doesn't seem to work either.&nbsp; It's quite odd considering I have done it successfully in the past.&nbsp; Am I doing something wrong?&nbsp;Image of block diagram attached.&nbsp;&nbsp;


Project3.jpg:
Loading Image...
nathand
2008-08-14 20:10:09 UTC
Permalink
It looks to me like that should work... do you know that your program runs at all?&nbsp; Do you see the LED on the local FieldPoint turn on and off?&nbsp; If not, perhaps you're not properly deploying the startup application.&nbsp; Forgive me if you know all this, but you should right click and set the application for startup, then build, then deploy, and finally power-cycle the FieldPoint unit to force it to restart.
Gizmaa
2008-08-14 20:10:10 UTC
Permalink
Better safe than sorry, I did set it as startup and reboot it.&nbsp; The LED on the local controller did turn on and off.&nbsp; I am lost for ideas.
Gizmaa
2008-08-15 15:40:08 UTC
Permalink
Success!&nbsp;All I have to do offer up a lab assisstant as a sacrifice to the Fieldpiont gods on the 14th day of the 8th month at the stroke of noon while humming the theme to &quot;Battlestar Galactica&quot;.&nbsp;&nbsp; It's that easy!&nbsp;Honestly I have no idea why it started working this morning.&nbsp; I added a second file output as shown in the&nbsp; attached image and it worked.&nbsp; The LED on the remote fieldpoint activates and deactivate along with both files being correctly written to the host datalogger.&nbsp;What would cause a fieldpoint to arbitrarily work/not work?


magic.jpg:
Loading Image...
Kevin_S
2008-08-15 16:10:06 UTC
Permalink
Hi Gizmaa,&nbsp;One item of note with FieldPoint units is how they connect to your network.&nbsp; As a FieldPoint supporter here at National Instruments, you wouldn't believe the amount of support calls that concern networking.&nbsp; The unit can periodically work or periodically drop from the network due to IP address conflicts.&nbsp; This article (<a href="http://digital.ni.com/public.nsf/allkb/50BE7BEA4D5285DA862573370070D30B?OpenDocument" target="_blank">How to Network FieldPoint to a Host Computer with Ethernet</a>) does an excellent job explaining how to troubleshoot networking issues. &nbsp;(Even if your controller is set to obtain an IP address from a DHCP server, your controller may still not be visible or my periodically drop from your network if something else on your network has a static IP address set to the one the DHCP server gave your FieldPoint controller.)&nbsp;Regards,Kevin S.Applications EngineerNational Instruments
Gizmaa
2008-08-15 16:40:19 UTC
Permalink
All our FPs are on an isolated network.&nbsp; I have a switch on the labtop.&nbsp; The IPs are all static and set by me specifically for the purpose of setting them up.&nbsp; There as been no loss of communication between the FPs and the computer through MAX.
Loading...