08-07-2005 10:17 AM
08-07-2005 12:20 PM
If you have analog input modules, you can connect a potentiometer to the FP, so you don't have to worry about communication.
If you still want communication, you can use TCP, which is very reliable if your network is OK. Search the example finder (Help>>Find Examples) for "TCP" and you will find several examples showing how to transfer data to and from a FP. You can also search the site for "TCP tutrials" for some more detailed explanations. Alternatively, you can use the RT Communication Wizard (Tools menu), which also uses TCP, but does the job for you.
In any case, the code should be written in such a way that if there is no communication, something happens (the machine stops, the setpoint goes back to a default, the setpoint remains at its last value, etc.). In any case, the communication loop should be seperate from the rest of your code, and that way the FP will not hang.
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
08-08-2005 05:47 PM
08-08-2005 11:44 PM
Hi Bob and Tst,
I am just curious... none of you mentioned the built-in watchdog feature of FieldPoint. Do you not use it? Or use it only as a last resort to take the outputs to a safe state?
Thanks,
-Khalid
08-09-2005 02:35 AM
08-09-2005 03:34 AM
Thanks tst
using another input channel on the module is not an option, thanks for the input
I will investigate the use of the TCP vi's, and thanks for the tips
Thanks Bob your techniques for the water plant program are exactly what I need to implement, plenty of food for thought there
Time to get stuck into some programming
08-09-2005 10:32 AM
When I originally architected the program, I considered using the watchdog feature for this and chose not to. The reason was simple: I wanted it to be
@Khalid wrote:
I am just curious... none of you mentioned the built-in watchdog feature of FieldPoint. Do you not use it? Or use it only as a last resort to take the outputs to a safe state?
08-10-2005 02:46 PM
Euromata,
Instead of the TCP VIs, you can use the PublishData.vi, located in NI Measurements>>FieldPoint>>FieldPoint RT palette. The PublishData.vi allows you to Publish a Read Only or Read/Write item. This item shows up as an additional channel under the [c]FP-2xxx module when the embedded program is running.
This simplifies your programming as you can create a channel called SetPoint as a Read/Write item. In your embedded code, you use the PublishData.vi (high level) or Read Publish Data.vi (low level), to read the current setpoint. This setpoint is cached locally and can be pre-initalized as part of your program. It will always be available to be read (embedded), and a client can connect, change it and disconnect without any programming required in your embedded program to handle the client. The client can connect using either a FieldPoint Write VI or DataSocket VI with Logos URL. The DataPublish.vi (and underlying technology) assume that the FieldPoint unit is a server and there is no negative effect when a client is disconnected. The DataPublish.vi (high level) supports a Timeout value that can be set to 0 (always Read immediately) or be a non-zero value (waits for a change of the value). If you use a timeout, then a loss of communications would stall your program by the timeout time, but if you set it to 0, loss of communications will have no effect.
Regards,
Aaron