indirtect address invalid subscript

Mgw1970

Member
Join Date
Jul 2019
Location
Magna
Posts
33
I have a indirect address V_Spray_[VARIETY_Number] MOV that works but when use a V_Split[Variety_Number] MOV I get a invalid array subscript? Everything is setup the same?
This is a conversion SLC500 to studio 5000. N70:[N25:5.0]
 
This is a conversion SLC500 to studio 5000. N70:[N25:5.0]

I think we will need more information then this. How is V_Spray_[VARIETY_Number] setup in the SLC? Which SLC processor are you using? Can you post screenshots of the two instructions in RSLogix 500 as well as the working and not working instructions in Studio 5000? I am going to guess that your problem is with the [N25:5.0] portion. That looks to me like it is addressing at the bit level (5.0), where as [VARIETY_Number] should be addressing at the word level if it was a MOV instruction. I didn't think you could use the MOV instruction at the bit level.
 
That looks to me like it is addressing at the bit level (5.0)

The . is the word delimiter in RSLogix 500 iirc, it would be /0 for bit level addressing. A bit odd to see it formatted like that when referencing an integer file though.


I'd like to see the working/nonworking instructions in 5000 for sure.

EDIT: If you're using the automatic conversion then N70:[N25:5.0] likely got converted to something like N70[N25[5]], and nesting like that is not allowed.
 
Last edited:
Looks to me like V_Split isn't an array. I would check to make sure it really is an array.

Also, as already stated, you can't dereference to the bit level inside an array index. What you want to do is something like V_Split[Variety_Number].0

Keith
 
Last edited:
Tried suggestions but I still get an invalid subscript. Plus I cant make larger array's to accommodate the old registers N70 and N25 files without getting errors.
 
I noticed that "Variety" was "VARIETY" (all caps) in the first case but "Variety" (camel case) in the second. Would those be different tags? Or was that just a typo?
 
Originally posted by Mgw1970:

Plus I cant make larger array's to accommodate the old registers N70 and N25 files without getting errors.

What errors are you getting?
How big are the arrays right now?
How big do you want them to be?
Are you making these changes online or offline?

Keith
 
This a offline project it is a conversion project from logix 500 to studio 5000.
I get invalid subscript errors.
To match the registers from the old data file N7 and N25 I would need Variety(Dint 249] and D_Index (Dint 30)
 
Usually, the conversion process will bring in even the values of the old program tags and name everything based on the original file:word/bit addressing, but it is possible to make use of symbols in the old program as aliases.

Are you getting Errors or Warnings? I seem to recall getting warnings about subscripts being out of range when the value stored in the tag (offfline) was not within the array bounds. Once the code runs or even by writing a valid value to it offline, those warnings would disappear.

If they're Errors, get us a screenshot of the rungs and exact wording of the verification error.
 
You can get a screen shot from the keyboard of the PC, just press CTRL + PRT-SCR. That will copy a bitmap to the Windows Clipboard, then open a bitmap editor and paste it there, where you can crop it, or annotate it as desired, save it to a file, and add it to the thread.

Your camera image appears to show an error with the tag VARIETY which is the subscript specifier. What are the properties of that tag "VARIETY"? Could it be a new tag that is not yet created? It will need to be an integer tag type (INT or DINT).
 
Variety is setup as a DINT[249]. While the VSpray_On is a DINT[10]. But I just changed the MOV instruction to Variety[VSpray_on] but the VSpray on I changed to a single DINT and error went away. I think I'm going to have to break down the original N25 file into different tags.

Screenshot 1.jpg
 
Then the MOV command needs to specify which element of the array VARIETY you want to use...
But...
You can't nest indirection in Controllogix like you can with the older PLCs. You would have to move Variety[x] to another tag that is a simple DINT (not an array tag) and then reference that tag in your shown MOVE instruction in place of the subscript VARIETY. But before you do all that, look at the old program at that same instruction to be sure that is what your conversion really started with.

EDIT: I just looked at the last part of your last post and the picture and I agree...let's have a look at the original code before we break your conversion by making it do something that is not like the original.
 

Similar Topics

Hi, I wanted to ask is there a way to have a visibility expression use the IP address of the HMI (Dynics, not PV) to show certain elements? The...
Replies
3
Views
166
Hello. I have a few machines that use Kinetix 300 (each machine has two drives). Both drives on one of the machine keep losing IP address. They...
Replies
2
Views
92
Hi Guys, Is it okay to have Redundancy ControlLogix Processor IP address set to DHCP? I had Static IP address on it but removed it via RSLinx...
Replies
3
Views
226
Hi everybody, I have DELTA PLC DVP-32ES and I have make a simple project in WPLSoft. using the input X0 to switch ON the output Y0 and using the...
Replies
0
Views
154
Kindly, I am trying to do some Modbus Rtu communication between a 1214C Siemens plc and the following slaves. ( Schneider PM5110 meter , Socomec...
Replies
4
Views
243
Back
Top Bottom