on 2014 Jan 31 4:24 PM
Hi All,
I am facing a new problem when I am trying to run PCoQuery from BLS.Suppose I have two tags, tag1 (data type Boolean) and tag2 (data type integer). In MII PCoQuery I have added those two tags in “Selected Tags” and passing value (Though there is a bug, we can’t directly write value in “Value” field, it takes only one character and then it goes on read only mode. But I copied the value from notepad and pasted it there). Then I executed the query and it was successfully and updated those value in PLC tag. Now I put [Param.1] and [Param.2] in value fields and used that PCoQuery in BLS. Form BLS I mapped some value for [Param.1] and [Param.2] (Like true for [Param.1] as it is Boolean and 100 for [Param.2] as it is integer). When I am executing the BLS it is giving me the error like – “Unable to convert supplied value to required type”.
Is there anything I am missing? Could you please provide any suggestion.
Thanks in Advance
Chandan
Request clarification before answering.
Hi,
The cause for this issue is the value which we pass is not getting recognized by the PCO query. So for this whenever we call the PCO Store Query from BLS and pass the input parameters dynamically i.e. SelectedTags and SelectedValue then we also have to pass value as "true" for the parameter "TagValueEncoded". This should resolve the issue.
Regards,
Abhijeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chandan,
Instead of "1" and "0" for boolean values, use "true" and "false". I have confirmed that this works with MII14.0 SP4 Patch 1 and MII 12.2 SP4 Patch 5.
As for the issue with the Value editor, please log a ticket on this so that Support can address it.
Regards, Steve
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steve,
I have used "true" and "false" for boolean field, It is working fine from PCoquery but it is giving error ("Unable to convert supplied value to required type") from BLS. I am also getting same error for integer field execution from BLS. Currently I am using MII 14.0.3.
Do you have any suggestion on it?
Thanks
Chandan
Hi Steve,
I have upgraded MII system to SP4 Patch 0 and I am trying to update tag value. But getting error. In PCo query I have used ‘[Param.1]’ in value field and mapped actual value with Param.1 in BLS but getting error like below
[Tag] : Exception [TokenizerException] - Token error (Unable to Retrieve Token), at location 46, expected tokens [AtKeyword,IncludeKeyword,CultureKeyword,DirectiveEndSymbol].
2/PR1/TAG1' = '' [Param.1]'';
But I have tried other way which is working. I kept value field blank for the tag in PCo query. Now I have used the query in BLS and mapped the actual value with “SelectedTagsValue” and I executed BLS. It is working.
Do you have any suggestion about the error.
Thanks
Chandan
Hi Chandan,
Using Param.1 to Param.32 is helpful in SQL Query but it is not of much use for the PCo Query as PCo Query has defined parameters for inputs like 'SelectedTags', 'SelectedTagsValue' and 'SelectedTagTimes' for the TagStore Query. All there parameters are comma separated strings.
This is the reason why when you create a TagStore PCo Query the Parameters Category remains disabled in the Template Categories of the Query.
So don't use the Param.1 instead use the Parameters exposed by PCo Query like mentioned above.
Regards,
Rohit Negi.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.