I have encountered an issue when using the MOV instruction to transfer literal text from a source operand to a destination String datatype. While it functions correctly in one program, in another program it displays an error message stating "Invalid Data Type. Argument must match Parameter Data type." I understand the error and its reason, but I am curious as to why it behaves differently in these two programs.
Welcome to the PLCTalk forum community! Are the controller models, firmware revisions, and versions of Studio 5000 Logix Designer consistent across both projects? Are the sub-elements within each User-Defined Type (UDT) using standard STRING default datatypes, or have they been customized to use STRING[x] with varying character lengths? Support for STRING type literals is a recent feature in Studio 5000 and is currently exclusive to 5580 or 5380 series controllers.
The current PLC software version is 34.11. However, there is an issue with the 1769-L3ERMS PLC model, while the 5069 model is error-free, despite both being updated with the same software version. The UDT strings are of type String[1], leading to the selection of data[0] as the correct string.
According to Shivsrikakolum, the PLC model 1769-L3ERMS is the one with an error, while the error-free model is the 5069. As pointed out by Ken, the issue lies in the fact that the 1769 series is a 5370 PLC that does not support string literals. Make sure to take note of this difference when selecting a PLC for your project.
Do you have any suggestions for potential solutions? Have you thought about possible courses of action? Share your ideas on what can be done!
Start by generating a STRING tag and inputting your preferred text, then proceed to copy from it. This simple process allows you to manipulate and reuse the content as needed.
Even without insight into your specific programs, it seems the discrepancy might be due to differences in the environments or frameworks of the two programs. Certain architectural or configurational variations might allow for different handling of data types. If both programs are supposed to operate under identical conditions, it'd be a good idea to double-check not only your code, but also the environment and build settings just to ensure that everything lines up. Also, remember that the MOV instruction doesn't do any type conversion. If the source operand and the destination aren't of the same type, you'll need to do the necessary conversions yourself.
It's possible that the two programs are interpreting the MOV instruction differently due to differing environments, compiler settings or versions. If one program uses a different compiler, it might implement stricter type checking and thus throw a datatype mismatch error. Or it might be the case that there's a configuration discrepancy at a lower level. Make sure to check the documentation relevant to each environment to understand these subtle nuances. It could also be helpful to post the specific versions you are using, along with any error message text and context, to get the most accurate assistance from the community.
It sounds like you're dealing with inconsistencies in how your two programs treat data types. The MOV instruction works with operand data in the context of the data types specified in the program. If one of your programs expects a different data type than your source text for the MOV operation, you'll get the error message you're seeing. It could be due to difference in data type handling between different versions of your programming language or libraries, or perhaps there is some underlying code in one of the programs affecting this. Try to dig into the settings, libraries, or version differences more and it might shed some light on the issue.
It sounds like the issue could rely in the context of how you're using the MOV instruction in the two different programs. It's possible that the destination String datatype isn't defined or handled the same way in both programs. Check out whether the environment settings, compilers or versions of the programs are identical. Another thing to note is the PRACTICE of implicit and explicit type conversions. Incorrect data type conversions frequently lead to bugs in programs. Look for different usage of these conversions in your two programs which might be causing this difference.
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: 1. Why does the MOV instruction behave differently in transferring literal text between programs? - The MOV instruction may behave differently in different programs due to variations in the data types of the source operand and the destination datatype. The error message "Invalid Data Type. Argument must match Parameter Data type" indicates a mismatch in data types between the source operand and the destination datatype.
Answer: - To resolve the error message, ensure that the data type of the source operand matches the data type expected by the destination datatype. This may involve converting data types or using appropriate data manipulation instructions before using the MOV instruction.
Answer: - Best practices for using the MOV instruction include ensuring consistency in data types between source operands and destination datatypes, verifying data compatibility before transferring, and handling any necessary data conversions or manipulations to prevent errors related to data type mismatches.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.