AOI, reference module channel.data as a real value

ellcap

Member
Join Date
Jun 2016
Location
NV
Posts
17
OK I'm ashamed that I'm here asking this as I think in 23 years I would have ran into this before. But here we are.

Created an AOI to manipulate Analog Input Data from an IF16.
I have an input parameter called Raw, data type real.
I go to past the path for the channel, Local:4:I.Ch5Data, and that fails with the error failed to modify the tag value, string invalid.

I can instead do a MOV of Local:4:I.Ch5Data to AOI.Raw and it works fine.

What have I done wrong for it not to resolve the channel string as a path to the real value it contains?

Sorry!
 
Without the full card part number its hard to say what's going on, but my first guess is the card data is in INT format.
 
the card type is real. But For this I can pretend its INT.

If my input type was INT and made a tag called "TAG", data type INT, it won't let me type the word TAG in there, it will reject it as a string and it want's an INT value. (or real in my case). It's like I can't get the parameter to interpolate the value of the tag, only that the data field i'm writing is a string and not numeric value. I've never ran into this before.
 
Your parameter is an input type, so it's passed by value. That is, you have to put a value in MyAOITag.Raw.

If you make the parameter an InOut type, it's passed by reference, that is, you tell it which tag to look at for the value of MyAOITag.Raw.

The error you're seeing is exactly as it describes - "failed to modify the tag value, string invalid" - i.e. MyAOITag.Raw needs a REAL (i.e. the numerical value of Local:4:I.Ch5Data, and instead you tried to enter the string "Local:4:I.Ch5Data". A string is invalid.

If you make it an InOut tag, what you'll see is that there are now two data areas for the Raw value - the first one is where you put the tag, and the second is where it shows the value of that tag.

Just to add my 2c: I prefer to have things like this saved as Input Parameters, and use a MOV to send the value in. That way I can do all my mapping in one place, and condition the values elsewhere according to requirements.
 
Your parameter is an input type, so it's passed by value. That is, you have to put a value in MyAOITag.Raw.

If you make the parameter an InOut type, it's passed by reference, that is, you tell it which tag to look at for the value of MyAOITag.Raw.

The error you're seeing is exactly as it describes - "failed to modify the tag value, string invalid" - i.e. MyAOITag.Raw needs a REAL (i.e. the numerical value of Local:4:I.Ch5Data, and instead you tried to enter the string "Local:4:I.Ch5Data". A string is invalid.

If you make it an InOut tag, what you'll see is that there are now two data areas for the Raw value - the first one is where you put the tag, and the second is where it shows the value of that tag.

Just to add my 2c: I prefer to have things like this saved as Input Parameters, and use a MOV to send the value in. That way I can do all my mapping in one place, and condition the values elsewhere according to requirements.

this answer makes perfect sense to me. And i too would use a mov (i guess i already am).

Where I'm confused is I'm looking at two other reference libraries of AOI objects where they have their "Raw" value declared as an Input and in those libraries they are able to use a tag in the faceplate of the AOI. So they don't need the additional MOV that I'm doing. I kind of don't care, I'll leave the move there, but I want to know why it's working there and not here.
 
never mind. I found that in the examples where it would resolve, the input was declared "required".
In mine, I didn't have it set "required".

I'm not entirely sure why the required attribute allows the input to read the value instead of the string. but anyway it answers my problem.
(to get around situations where I don't know the channel but still want to deploy the instruction I reference the InstanceName.Raw, which is a circular reference to itself, but it seems like it's not too mad at me)
 
Last edited:
Ah, of course. My initial post was not quite correct. InOut parameters are always Required, so using an InOut parameter gives you both entry fields and "requires" you to assign a specific tag - but so does checking "required" on a standard input or output parameter. It's the "required" function that controls that, and making it an InOut parameter just so happens to force the tag to be "required" (since an InOut parameter is passed by reference, it has to be required).

I've never liked the wording they use there - "required" makes it sound like you can uncheck it to make the parameter optional.
 

Similar Topics

Hey! Im working on a system with about 40 conveyors. Now this system was originally designed to be controlled by switches on a control panel, and...
Replies
19
Views
12,054
Hi all, hope you are having a great day, I am in need of your help to create a AOI or program that does this kind of job: I have a IO Link...
Replies
20
Views
257
I have a PH meter that I am trying to bring its data into 1756-L81. I have downloaded the Rockwell MODBUS AOI kit, but I am not sure if I need to...
Replies
5
Views
168
I am very new to Modbus and the industry, so forgive me if I am missing something obvious. I have known Modbus register addresses coming from a...
Replies
7
Views
231
Does anyone know of an AOI using the user ASCII protocol select on the L6x controllers that will talk Modbus RTU using RS-485? Thanks, Trevor...
Replies
1
Views
134
Back
Top Bottom