From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

DNP3 Write Binary Output

Solved!
Go to solution

Any help would be greatly appreciated. 

 

I am currently working on creating an HMI/SCADA in LabVIEW that communicates via DNP3 Master Protocol to an SEL RTAC (real time automation controller).  The RTAC is connected to a SEL 351s which is basically a relay.  I have no problem reading analog inputs and binary inputs from the RTAC which receives the data from the 351s, but have been very unsuccessful in attempting to write to the 351s by using write binary output blocking send command vi in LabVIEW.  Basically, I have four binary output bits from the 351s which hold the status of a circuit breaker that I need to be able to control.  That is, I need to be able to write either true/false to a binary output value.  The point index for the values are 0:3, however, by using the range and values controls that connect to the DNP3 master vi, I am unable to control anything and usually get the IIN response status message.  I just need to be able to write t/f to different point indexes in the binary outputs of the 351s that is connected to the RTAC via SEL serial protocol, that is then connected to my LabVIEW as an outstation to my LabVIEW master program.

 

I could really use any help in making this work.  

 

Thanks,

Drew

0 Kudos
Message 1 of 11
(6,204 Views)

If anyone needs any more information to help, or if I need to clarify anything, please let me know.

 

Thanks, Drew

0 Kudos
Message 2 of 11
(6,131 Views)

Hello Drew,

Some questions need to be confirmed with you.

1. Did you refer to the "Master Application.vi" when you created your Master VI? "Master Application.vi" indicates how to perform binary output too.

2. Did you try to build the master and outstation both on your PC? You can view the example VI, "Display Binary Ooutput Point.vi", as the outstation. In this way, you can find if there is something wrong on the Master VI.

3. Could you please send your Master VI to me for investigating?

 

Additional, according to your description, you should set the range from 0 to 3 and set values T/F. Please refer to the below screenshot.

Write Binary Output.JPG
Thanks!

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

Hey ThreeLions,

 

Thank you so much for responding to my question! Let me see if I can't answer your questions so you can see what my issues are.

 

1-I didn't refer specifically to the "Master Application vi" but I did use the write point and poll point vis to help create my own master.

 

2-I have built the master on my pc, but the "outstation" is the SEL RTAC device that we connect via an ip address.  Before connecting directly to the RTAC, I used a Master/Slave simulator to test the Analog/Binary Input/Outputs, but had issues with writing binary outputs to it as well.  Should I create an outstation in labview to test my master?

 

3-My master vi is attached with some changes that I made using your screenshot. 

 

What I am having issues with is getting the write binary output block to work.  The Analog and Binary inputs are correctly read from the RTAC, but when trying to control binary output switches, I am unable to do anything.  Basically, I need the write binary output block to allow me to use toggle switches to make them true or false.  The point indexes for the binary outputs that we are currently testing are 0 to 3.  Hopefully this has clarified things, but if not, please ask me any questions you have.  Any help would be appreciated.  

 

Thanks,

Drew

 

PS- I have been able to toggle the binary output bits using the Control Relay Output Block, but I am not sure exactly how I am doing it and I really need the functionality of pressing a button/switch and have the binary bit toggle from 0 to 1 or vice versa.

0 Kudos
Message 4 of 11
(6,102 Views)

Hi Drew,

1. I have tested your Master VI and it can send out T/F normally.
For testing binary output, I disable some unnecessary VIs. And I shift the "start" and "stop" of the "range" to solve the error -44251. I use a example VI, "Display Binary Ooutput Point.vi", as the outstation. You can find it in <National Instruments>\LabVIEW xxxx\examples\DNP3\Get Started\Outstation.
In the Master VI, the "values" of the binary output is "F,T,F,F". In the outstation VI, you can see all 4 points by switching the "read point index" and the "Control" of "CROB value" indicates the status. They are "Latch Off,Latch on,Latch Off,Latch Off".

2. You can find 2 example VIs in <National Instruments>\LabVIEW xxxx\examples\DNP3\Get Started. The master is "Control Binary Output Point.vi" and the outstation is "Display Binary Output Point.vi". These 2 VIs use Control Relay Output Block(CROB) to perform binary output.
The "Send CROB.vi" sends one integrity binary command to outstation. You can send a intergrity command to outstation instead a binary output.
However, the "Send Write Binary Output.vi" which we are using in your Master VI, sends one binary output to outstation. So it can only changes the "Control" of "CROB value".

3. In order to using the "Send CROB.vi", you can refer to the master example VI, "Control Binary Output Point.vi".
Please see the below screenshot. You should set the "point index" from 0 to 3. In the "Control", "Latch On" represents "T" and "Latch Off" represents "F".

CROB values.JPG

 

4. When we use the "Send Write Binary Output.vi" in Master VI to send binary output and use the example VI, "Display Binary Ooutput Point.vi", to be the outstation, we will get "IIN" response from the "Send Write Binary Output.vi". But, in my test, it will not impact the sending of T/F. Of course, if you use the "Send CROB.vi", the response will be "Success".

Thanks!

0 Kudos
Message 5 of 11
(6,083 Views)

Three Lions,

 

First of all, thank you so much for your help.  

 

I have been able to use the CROB to successfully send data to the binary outputs by setting the point index for each place and choosing either latch on/off while the count is set at 1 and both times are 0.  However, I have still be unable to get any data to change just using the write binary output block, so I'm not sure if I'm just not setting up the cluster, stop/start range or the values correctly.  I get that the write binary output only seds the control portion of the crob, so is there a way to set up my own so all I have are boolean switches that represent the different point indexes?  in addition, some of the binary outputs are tied together in a way that if one is true, the other is false.  So is there a way to design a few boolean switches that trigger latch on or off based on their state.  And if let's say point index 1 has to be true when 2 is false, and vice versa, what's an easy way to do that?  Are case structures with the CROBs in them my best bet?  Or can I use the write binary output block several times to change different controls and values?

Thanks

0 Kudos
Message 6 of 11
(6,076 Views)

I basically just don't need all the functionality of the CROB, just latch on or off.

0 Kudos
Message 7 of 11
(6,075 Views)

Hello Drew,

 

1. I get that the write binary output only seds the control portion of the crob, so is there a way to set up my own so all I have are boolean switches that represent the different point indexes?

I am not sure if I know this question clearly. Do you want to set up controllable boolean switches instead of constant? If so, you should replace constants with controls, like the below screenshot. And the boolean array, values, indicates the T/F of every point indexes from start to stop.

original.JPG

2. So is there a way to design a few boolean switches that trigger latch on or off based on their state?

You can achieve it by code but there is no exist property or method. I give you a simple intro to illustrate.

According to your description, point index 1 has to be true when 2 is false, and vice versa.

1. Index 1 and 2 of the boolean array by In Place Element Structure

2. Change T/F of index1 based on the status of index2 by Case Structure

3. Change T/F of the boolean array on the front panel by Property Node

triiger.JPG

3. However, I have still be unable to get any data to change just using the write binary output block

Did you already try to use the example "Display Binary Output Point.vi" to be the outstation? If you use "Send Write Binary Output(Blocking).vi" in your Master VI, did the example "Display Binary Output Point.vi" can receive T/F values?

If so, I suppose the SEL 351s cannot support binary output directly. Moreover, as your said, the SEL 351s is basically a relay. So I think using CROB is more reasonable.

 

Thanks!

0 Kudos
Message 8 of 11
(6,066 Views)

Thank you again for your help, so I apologize if I keep asking questions.  I think I am getting a better handle on things, but if using the CROB is better, is there a way to wire it up so lets say I have a set of 3 boolean switches/toggles, where switch 1 controls the T/F (latch on/latch off) of point index 0 in the CROB, swtich 2 controls T/F (latch on/off) of point index 1 and 2 (where if 1 is T, 2 is F and vice versa), and switch 3 controls T/F of point index 3?  This is setting the count of all of these to be constant at 1, and the time on/off is constant at 0 for the CROB blocks.   And can I do this without having to have the standard CROB block on my front panel, that is just replace it with the switches and corresponding led?

Thanks,

Drew

0 Kudos
Message 9 of 11
(6,055 Views)
Solution
Accepted by topic author andrew32

Hi Drew,

 

No problem. The data type of "CROB value" and "Control" are both cluster. So you need to bundle your logic (Latch On/Off) into the cluster. Please see the attachment. I create a brief sample and make the logic of switch1 as the example.

0 Kudos
Message 10 of 11
(6,049 Views)