Dimitry Stepanoff

Error "Invalid expression or tag" when uploading a project from a controller

20 posts in this topic

Hello!

Uploaded the project from the LOGIX 5343 controller (via the Upload menu item). There are no project sources. When executing Verify Controller, the same type of error messages are displayed:

Error: Rung 0, PneuAligner, Operand 1: Invalid expression or tag.

Error: Rung 16, Rejects, Operand 8: Invalid expression or tag.

Error: Rung 3, CTONOFF, Operand 6: Invalid expression or tag.

It is not possible to download the project back to the controller, respectively (and this needs to be done due to the need to make changes to the work logic). At the same time, it turns out to switch to Online mode without problems, while in places where problematic blocks are called (Add-On Instructions), instead of missing tags, the inscriptions "1.0.0" and "0.0.0" with the tag value "??" are displayed. The inputs of the blocks to which the missing tags are fed are of the Bool type.

RSLogix 5000 screenshots with a list of errors and problematic tags on the example of one error:

"errors.png" - errors

"inside Rejects online in Automatic mode.pnd" – tag value inside the block

"outside Rejects online in Automatic mode.png" - tag value outside the block

I would like to get help in answering questions:

1. How could there be blocks (Add-On Instructions) with missing tags in the controller, if the same project is not loaded back into the controller?

2. How does the controller handle the situation with missing tags (takes the value of the missing tag as a logical 0 or something else)?

3. What is the best way to solve the problem with filling the modified project into the controller? It is clear that you can substitute logical zeros instead of missing tags, but I would not like to take risks without understanding the consequences.

Thanks!

errors.png

inside Rejects online in Automatic mode.png

outside Rejects online in Automatic mode.png

Share this post


Link to post
Share on other sites

Just to review: An invalid expression error means there's an error in the syntax of the written expression. For example, if I were attempting get the mean average of three tag values using the CPT instruction I would write the following expression: "(Tag1 + Tag2 + Tag3) / 3".

But what if I screwed it up and added an extra operand, like a multiply right next to an add: "(Tag1 +* Tag2 + Tag3) / 3". This expression now has an error, and the error description will be "invalid expression or tag".

The same error would occur if I entered a tag that didn't exist, whether it's a tag that hasn't been created or one that has been deleted.

As you know, errors can not be downloaded to the controller so this will have to be remedied. To try to begin to answer your questions:

  1. You uploaded the project from the controller, and are now finding these errors in the uploaded project? Or did the errors show up after modifications were made to the code? Seems to me like it would have to be the latter because offline errors don't download and online edited errors will not be allowed to be tested or replace existing code in the run mode. 
  2. If any instruction is missing its tag the error will be "Instruction has no arguments specified". If an instruction is missing other vital info (ie, no value written in the "Preset" field of a TON) the error will be "Missing operand or argument". My experience is this rule applies to AOIs, as well, but if anyone has more or different information on this I'd love to hear it. In the screenshot showing the AOI with zeros in the "External_Req", that line of code appears to be in the edit mode (lower case "e"s on the rung numbers) and I believe the 0s and ?s are the controllers way of telling you there's an error here. Any time you see a "?" in Rockwell code there's a problem. Due to the multiple decimal points, I'm wondering if that field is expecting to see data from a multi-dimension array. Or it could just be that's the default filler for missing tags/values in an AOI. I'd like to see the code for the AOI and play with before I said anything more specific.
  3. Since the AOIs seem to be the source of your issues, I would open their profiles to examine their tags, parameters, and logic. Chances are that tags not created in the AOI(s) profile were added to the code as part of the edit, or tags the AOI(s) depend upon were deleted during editing. Hopefully the original programmer left some descriptions in there for you to help understand how and why the AOIs are used, which will help a lot in rebuilding what's missing or corrupted.

Hope this helps.

Share this post


Link to post
Share on other sites

Looking at rung 16 in the last screenshot, what would cause the letter "e" to be there with the rung lit up green? The green indicates that it's being scanned, which would tell me that it's in the online processor properly. When doing online edits in RSLogix 5000/Studio 5000, the letter "i" shows up, but not "e". I see "e" when editing a rung in RSLogix 500, but the rung isn't lit up green in that case. Interesting...

I wonder if there's a conflict somehow between the AOI in the offline (uploaded) file and what's online?

Total speculation....

Share this post


Link to post
Share on other sites

The lowercase “e”s mean that that line of code is being edited. Lower case “i”s mean the edits have been accepted (no errors) and are ready to be inserted. A bright green power rail does mean the controller is in the run mode. However, it does not mean that particular routine is being scanned, because it would have to be called by a JSR. 

All that to say, yes, seeing the e’s next to a green power rail is definitely not the norm. I really wish I could be there in person to drive around in this one myself. 

Share this post


Link to post
Share on other sites
4 hours ago, Joe E. said:

Looking at rung 16 in the last screenshot, what would cause the letter "e" to be there with the rung lit up green? The green indicates that it's being scanned, which would tell me that it's in the online processor properly. When doing online edits in RSLogix 5000/Studio 5000, the letter "i" shows up, but not "e". I see "e" when editing a rung in RSLogix 500, but the rung isn't lit up green in that case. Interesting...

I wonder if there's a conflict somehow between the AOI in the offline (uploaded) file and what's online?

Total speculation....

Edits would not be possible with the processor in run mode.

aaa.png.c3a852dd459f4a0a8eeab5136d677ac9

Share this post


Link to post
Share on other sites

Exactly. So what are those “e”s doing there. Something is clearly amiss. 

Share this post


Link to post
Share on other sites

Look at the programming PC time in the screenshots.

3:38 going online complete 0 errors 0 warnings

3:39 going online complete 0 errors 0 warnings

3:47 lots of errors.

I think an AOI has been modified causing the errors.

Share this post


Link to post
Share on other sites

I agree and said in my first response that I think the AOI tags have been modified or deleted. Still waiting to hear back from the OP. 

Very keen of you to catch the PC time stamps in the pics. Still doesn’t explain how he’s online and appears to be scanning code that’s also in edit mode. That’s the Big Mystery to me right now. 

Share this post


Link to post
Share on other sites

I've never tried what happens if your in program mode with an edit then force run mode via key switch? 

Might have a play tomorrow. 

Share this post


Link to post
Share on other sites

Sooo.....in Logix/Studio 5000, when doing an online edit, I get a lower case "i" as soon as I enter "edit" mode of the rung and the power rail is dark next to it. the original version of the rung is marked "r" and power rail is on. When the rung is being edited and is invalid, a red "X" circle shows up until the rung is valid. Once the rung is valid and accepted, the rung flags become capital "I" and "R". While testing, the power rail switches so the "I" rung is lit and the "R" rung is not. Once assembled, the extra rung and rung flags go away. Throughout the editing process, in 5000, I never saw the "e" at all. I only saw that in 500. And never while the power rail was lit up.

As an additional test, I switched the PLC to "Program" mode with the mode switch and initiated an online edit. The "i" and "r" followed the same pattern except that accepting the edit also assembled it (no intermediate test, as expected when it's not running). With the switch still in Program, I then made an invalid edit and switched it to Run. I was unable to complete the edit. The only option was to cancel the rung edits, but at no point did I get the "e". Even switching the mode switch to "Run" while an edit was active didn't give me an "e".

So...I created an AOI, a really simple one. You can't do that online, so I did it offline and downloaded. I then created several errors but couldn't reproduce the "e" indicator.

The other error messages in the first screenshot show up when the controller is offline, so I suspect, like the others, that something got messed up while offline. The "e" indicator is still a mystery to me, though. They were online in run mode with something weird happening with that tag value....

 

Share this post


Link to post
Share on other sites

Hi!

Recorded two videos today:

https://drive.google.com/file/d/172hILCVcjAKAi_tH3d2sPnUvIFQ3C5DC/view?usp=sharing – in the video, I upload a project from the controller. Immediately after downloading, I follow the links in the error list. It can be seen that the characters "e" are displayed immediately, I haven't had time to change anything in the program yet.

It is also seen that inside the AOI "AXM" the missing input tag “HomeDone" has a value of 1. In the AOI code, “HomeDone" is not set to 1 anywhere, so this tag received the value 1 at the AOI input. I attached the AOI “AXM” code as a picture at the end of this post (I couldn't copy it as text, apparently there is protection)

 

https://drive.google.com/file/d/1g06G7-qzPdw1hv6UP15F82AWLRXONain/view?usp=sharing – in this video, I create a new input parameter TestBool in AOI "PneuAligner", make it required (as well as the existing Enable tag). After that, when executing VerifyController, two new error messages appear with a different text "Invalid number of arguments for instruction". Apparently, the reason for the problem of missing tags is not a change in the list of AOI input parameters by one of the programmers.

 

I have no way to contact the programmers who developed the project.

 

Have I answered all the questions? I ask you to ask more questions if this can solve the problem.

 

Maybe there are suggestions on how to solve the problem?

Thank you for your help!

AXM.png

Share this post


Link to post
Share on other sites

So I found a knowledgebase article that explains the rung status indicators (access level: TechConnect), but I don't think it's totally accurate:
https://rockwellautomation.custhelp.com/app/answers/answer_view/a_id/106109/

When online, "e" means there's an error. It changes to "i" when all tags are present and rail-to-rail logic is valid. I was never able to replicate the "e" indicator, either in v20 or v32.The letter stays "i" but there's an "X" next to the rung number until it's all valid. But it does point to a corrupted AOI. It's correct in the PLC but the software corrupts it while uploading.

Since your AOI is ST instead of ladder, I don't think it applies directly, but I've come across another tech note (access level: TechConnect):
https://rockwellautomation.custhelp.com/app/answers/answer_view/a_id/866333
It discusses an anomaly when uploading ladder logic if you have controller-scoped tags aliased to program-scoped tags. It was an anomaly in v24.00 that was fixed with 24.02. Whatever major rev you're using, I'd go to Rockwell's Compatibility and Download Center and verify you have the newest minor revision of that major revision. If you're already at the newest minor rev, I'm not sure what to suggest now. I suspect the AOI is getting corrupted somehow upon upload. If you have access to another PC with the programming software, you could try that one and see if you get the same result. Or uninstall and reinstall the software.

Share this post


Link to post
Share on other sites

@Joe E. The first article you posted is dated Feb 2020 and is for RSLogix5000 (pre-V21). The OP's project is clearly written in Studio5000 V28 or earlier, so the article may be a valid resource for this. However, the E, e, I, i, R,r, and D designations have gone through many changes over the various Studio iterations, and as Rockwell instructor I know firsthand how challenging keeping at all straight can be. In my personal experience, on pre-V21 versions of Studio (and as I recall), as soon as you enter the online editing mode, the top line (the one that's being edited) automatically gets an "e' regardless of whether there are errors. The lower, duplicated line gets an "r". They change to upper case once the edits are accepted but not yet compiled/assembled. They changed the e and E to i and I in later versions. Pain in the butt. Regardless, I've always been trained by Rockwell that "e" means editing, which flies in the face of the article you posted. Go figure, lol. 

For the OP's problem we're really down to two questions: Why are the "e"s there when he's clearly not in the online editing mode, and why has he got the invalid expression errors.

I've bounced the first question off a couple of colleagues who both offered the same explanation; someone began an online edit to the controller and then logged off mid-edit without exiting the edit mode. The e's are now permanently in the code. My super-nerd friend who has a demo at home tested this replicated it exactly. The e's were ever-present after the mid-edit disconnect, and showed up on all subsequent re-connects and uploads. The only way he could get rid of them was to download the original project, overwriting the e's. To sum it up, the OP's code will likely have to be uploaded, corrected offline, saved, and downloaded to get rid of those non-online editing mode e's.

Based on the above responses, I thing we're all on the same page about the expression errors. Something is wrong with his AOIs. I'm thinking it's tag related and he's just going to have to pour over it until he finds the issue. I hate how much of a non-answer that is but I/we don't have the code in front of us. 

@Dimitry Stepanoffare you able/allowed to post the .acd here? 

1 person likes this

Share this post


Link to post
Share on other sites

@ElectronGuru That makes sense about the letters since that's the behavior I see in Logix 500. I flashed my desktop -L33ER back to v20.19 and did some tests. The "e" indicator shows up when the rung is being edited but is invalid and changes to "i" when it's being edited but is valid. Then switches to uppercase letters as the edit is accepted and tested.

I started an online edit and then went offline with it invalid (XIC with a missing tag) and closed the file without saving. I then went online with the old file and it went online without issue or indicators. Next, I uploaded without a file and, again, the file uploaded without any extra "e" indicators. I haven't been able to replicate what your colleagues found, in v20 or v32, but I think their findings are very interesting. In my testing, mid-edit rungs that are valid/invalid don't show up at all when uploading. Mid-edit rungs that are being tested DO show up, along with the original rung (upper case "I" and "R" indicators). So far, I haven't been able to get it to upload an invalid rung. Do you know what version of software/firmware they're using? Today's test has all been in firmware v20.19 and software v20.04.

I also can't quite figure out how to end up with an invalid AOI inside a running PLC, even in an edited rung. You can't edit AOIs online. This is a really interesting issue....

Share this post


Link to post
Share on other sites

@Joe E. I'll have to ask my friend what version of Studio he was using and what controller.

The e's may or may not be just an annoyance but the real question is, why the invalid expression error? My guess has always been that the AOI was modified off-line and then downloaded. If the problem is with the AOIs. it's almost certainly related to AOI tags or parameters because code errors are not allowed to be downloaded and as you said, AOIs can't be modified online.

Share this post


Link to post
Share on other sites

The first thing that jumped off the page at me is when I verified the project, all of the errors are due to the value "x.x.x" being in a BOOL datatype within the AOI parameters. I'm not sure what's causing this or what to do about it, but will continue to look around.

Anyone else see anything like this somewhere and have a solution?

Share this post


Link to post
Share on other sites

So, RA's knowledgebase site gave me a hit this time that it didn't before...

The ACD file is v16, which has a known anomaly (access level: everyone):
https://rockwellautomation.custhelp.com/app/answers/answer_view/a_id/43221/loc/en_US

It refers to the release notes for v16, but the embedded link doesn't really work so I attached it here. See page 7 of the attached pdf.

There's a problem when an AOI is uploaded when a BOOL parameter has a literal value entered (1 or 0 instead of a tag). It says that every upload/download of the project will append a ".0" to the end so that, after the second cycle, it won't validate any longer.

Based on my reading, I would try to replace each *.0.0 with just the first digit. That *should* validate and leave the program running as originally written. The proper fix would be to either replace each "1" or "0" with a BOOL tag that's forced to be either 1 or 0, or update to v17 or newer. I would first change the literals to just the first digit and test going online. Then save and then make the changes to make it work long term.

AB_RSLogix 5000__16.05.00_ReleaseNotes_2018-11.pdf

Share this post


Link to post
Share on other sites

@Joe E. that's good work, man! I'd bet money that solves his issue!

Share this post


Link to post
Share on other sites

Thank you so much for your help! :-) Apparently, the solution to the problem has been found. As soon as possible, I will check the solution

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now