LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OPC-RSLinx-Block reads and writes

I'm in the process of learning to use OPC/Datasockets to read and write to
an Allen-Bradley PLC5. Using the examples (Labview 7.0), I can
successfully read and write individual items in the PLC files.

But I need to read and write blocks of data (ex: B3/001 to B3/100). The
examples don't show how to do this, and the RSLinx documentation is obtuse.

Anyone have any experience/advice on this? Thanks!

Andrew Russell
San Diego
0 Kudos
Message 1 of 3
(2,480 Views)
Hi Andrew,

I'm not sure how to write blocks through RSLinx, but if you are able to write a single block, it should be relatively simple in LabVIEW. If you include all of the blocks that you wish to write in an array, then you can pass the array into a For Loop. With auto indexing enabled, the loop will automatically iterate once for each element of the array. You can use this feature to use the DataSocket write VI to sequentially update each of those items on the PLC.

I hope that this helps.

Regards,
P.J.
National Instruments
0 Kudos
Message 2 of 3
(2,480 Views)
P.J.,

Thanks for the response! Yes, I could build large For/Next loops and read
and write individual sequential elements that way. But it wouldn't be very
elegant, and I'm betting there's a way to do block reads and writes.

If I don't turn up a "block" OPC call, I will probably follow your advice.

Andrew Russell
San Diego


pjtanz wrote:
>Hi Andrew,
>
>I'm not sure how to write blocks through RSLinx, but if you are able
>to write a single block, it should be relatively simple in LabVIEW.
>If you include all of the blocks that you wish to write in an array,
>then you can pass the array into a For Loop. With auto indexing
>enabled, the loop will automatically iterate once for each element of
>the array. You can use this feature to use the DataSocke
t write VI to
>sequentially update each of those items on the PLC.
>
>I hope that this helps.
>
>Regards,
>P.J.
>National Instruments
AuthiMini de Espana
0 Kudos
Message 3 of 3
(2,480 Views)