FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

cnidatasocket write is unable to write a 1 to the relay bank of a fieldpoint module

I am unable to write a 1 to a relay bank of a fieldpoint module using code that previously worked in the past.  I am using Visual Studio 2005 and am attempting to write a 1 or turn on a relay in the relay bank (FP-RLY-420) of a Fieldpoint module (FP-2000) using a CNiDataSocket object.
 
int nData = 1;
m_oDataSocket.Data.Value = nData;
 
I can write a 0 or turn off the relay if I turn it on through Automation Explorer.
 
int nData = 0;
m_oDataSocket.Data.Value = nData;
 
I am also able to query the state of the relay using correctly.
 
int nData;
nData = m_oDataSocket.Data.Value;
 
Any help would be much appreciated.
0 Kudos
Message 1 of 10
(6,124 Views)
Here is some additional informaiton I was able to gather.
 
The problem does not occur if I am running with DataSocket 4.1 installed and it will occur if am am running with DataSocket 4.3 installed.  If I create an installer to install my code on a target machine and include the required merge modules for data socket then DataSocket 4.3 will be installed onto the target machine and the writes to the relay bank will not work properly.  If I do not create an installer to install DataSocket and instead install DataSocket 4.1 standalone the problem does not occur. 
 
If DataSocket 4.3 is installed I am able to write a 1 to the relay bank using NI Automation Explorer?  Does Automation Explorer use DataSocket to communicate with Fieldpoint Modules?
0 Kudos
Message 2 of 10
(6,089 Views)
This issue with DataSocket 4.3 has actually been reported to R&D (ID: 3R6DC1TG) for further investigation.  R&D is currently investigating this issue.  For now, it will probably be necessary to use DataSocket 4.1 or 4.2.  We appreciate your feedback!
 
Measurement and Automation Explorer uses TCP/IP to communicate with FieldPoint.  The issue lies with the DataSocket driver.
 
Regards,
 
Clint M
National Instruments
0 Kudos
Message 3 of 10
(6,054 Views)
Do you know how I could use TCP/IP to communicate with the Fieldpoint module and bypass datasocket alltogether?  I would prefer to communicate this way but have never found supporting documentation .
0 Kudos
Message 4 of 10
(5,834 Views)

There are several ways to communicate with the FieldPoint.  The most common method would be to use shared variables, but direct TCP/IP communication is also available to you.

Real-Time VI To Host VI Communication Methods

Let us know how things progress!

David_B
Applications Engineer
National Instruments
0 Kudos
Message 5 of 10
(5,823 Views)
My apologies!
 
I just realized that your question is specific to using VS 2005!
 
It looks like you are either using C or C#, can you confirm which?  I assume that you will simply use one of their libraries in order to write to the TCP/IP port.
 
To do it in LabWindows/CVI however you can refer to 'Using LabWindows/CVI DLLs in LabVIEW Real-Time Applications'.
 
Keep us updated.  Thanks!
David_B
Applications Engineer
National Instruments
0 Kudos
Message 6 of 10
(5,813 Views)
Thanks for the reply
 
I noticed that the TCP communication document you referred to was for communication between VI's. 
 
I need to communicate with the Fieldpoint controller using TCP. I am using C and will just be using the low level socket commands to establish and communicate with the Fieldpoint device.
 
You don't happen to know what commands I would issue once the connection has been established.
 
I need to read integer and floating point values from a RTD, RLY and AI bank.
I also need to write (0 and 1) to a RLY bank.
 
Thanks
0 Kudos
Message 7 of 10
(5,811 Views)
Actually, you are going to basically define the commands that you are expecting. 
 
You will need to write the program on the FP in such a way that you interpret the incoming code the way you'd like.  Basically, all TCP/IP communication is sent using strings and you will just need to unflatten them or typecast them into the data format you are expecting and then use a case structure to perform the desired function.
 
Does this help?
David_B
Applications Engineer
National Instruments
0 Kudos
Message 8 of 10
(5,807 Views)

Do I need to write the code on the FP in LabView as a Vi?

0 Kudos
Message 9 of 10
(5,804 Views)

You don't need to: 

Can I Use Microsoft Visual C++ 6.0 and/or Visual C++ .NET with My FieldPoint Modules?
Can I Use Visual Basic with FieldPoint?

However:

FieldPoint Measurement Studio 7.0 Visual C++ API Has Been Obsoleted

In your case, I believe you will be able to write this code in C.  When you install the FieldPoint software, a LabWindows/CVI Instrument driver for FieldPoint is installed if LabWindows/CVI has already been installed on your computer.  This includes functions panels to call C functions that directly access the I/O items you configure in the FieldPoint Explorer program.  In addition, examples are placed in your LabWindows/CVI samples directory and will be your best way to familiarize yourself with these functions.

Hope that helps,

 

David_B
Applications Engineer
National Instruments
0 Kudos
Message 10 of 10
(5,779 Views)