LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Reading a Shared Variable Array

Hi,
I am having a problem reading an array of 20 unsigned integers from an Allen Bradley ControlLogix PLC with Labview.
 
I have set up a shared variable for this purpose.  I have set the Data Type of the shared variable to ArrayOf Unit16.  The Variable Type is Network-Published, and I have check the Bind To Source checkbox.  I think my problem is in the shared variable path.  I have tried the following with no success:
 
MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\Faults
MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\Faults[0]
MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\Faults[]
MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\
MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults
 
I have created a simple vi for testing.  I have wired the shared variable to an indicator which is an array of UInt16 items.  When I run the vi, I get an error which says "Error 91 occurred at Variant to Data in Text.vi.  Possbile Reason:  The data type of the variant is not compatible with the data type of the input."
 
Does anyone have a suggestion as to what I am doing wrong?
 
Thanks in advance for your help,
Phil
0 Kudos
Message 1 of 2
(2,636 Views)
Phil,

In order to determine that you can correctly communicate with your OPC server, I would suggest creating a shared variable bound to a single tag. It sounds as if you already have an RSLinx I/O Server in your project library. Now you can create a new shared variable and use the browse option to browse the items of your I/O server. Be sure to select a tag that has a known value such that you can verify successful communication.

Also, does your VI utilize a dynamic data conversion? The error code mentioned (error 91) is normally associated with this data type. Our next step will be to look at this VI once we can establish successful communication. I hope this was useful for you. Please let me know if I can be of further assistance.

Mike
National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(2,626 Views)