strantor_

CP1H does not support STRING data type in ST?

7 posts in this topic

I am playing with sending ASCII string commands back and forth between my CP1H and another device. I learned first how to do it using ladder and now that I'm getting into more advanced stuff (parsing, searching for certain chars, converting to INT, ect) I want to do it in Structured Text because the ladder for this gets hard to follow. My very first experiment (count string length) throws an error at me:

1.png.50e1d7f8296eb3eb181d254a7b69a1d2.p

It apparent takes exception that I've use the "STRING" data type

2.png.de2dba5bd474dd20984e2a731cdc9017.p

 

But it this works just fine in ladder:

3.png.e0960232f729ffd5397da03edea56e8f.p

 

So am I really not allowed to use STRING data type in ST on CP1H or am I doing something wrong?

1.png

Share this post


Link to post
Share on other sites

I just tried to do the same thing in a ladder FB. String variable, it gave me the same error. But then in the FB I changed the variable type to WORD and it worked. "neat" little workaround in ladder FB, but too bad it doesn't work in ST. in ST I get this error:

1.png.cdd748b9e323140fbc1411ce3ff660d7.p

Share this post


Link to post
Share on other sites
27 minutes ago, gclshortt said:

https://www.fa.omron.com.cn/data_pdf/mnu/r144-e1-04_cx-programmer.pdf?id=1605

Try to convert the information before sending.
Syntax
Source_data_type_TO_STRING (Variable_name)
Example: WORD_TO_STRING (SerialBuffer)

See page 95 of the above quick reference.

This may help you out.
Regards,
Garry

 

I appreciate it but, no, it's not having any of that either.

It won't let me define a string variable in ST.

And if I try to get away without defining a variable (put conversion directly into TXD) it tells me "instruction not available for current PLC"

1.png.a41b0ed2d8506caae1590ee770e27c44.p

 

How frustrating! I didn't see this restriction printed in any documentation before I selected CP1H for this application, and I still don't. I have looked hard through all my manuals twice and I don't see this printed. In CP1L/H Programming manual W451, CX-Programmer manual W447, CP1H operation manual W450, it is never mentioned that I can find! It really lead me to believe it as capable. Omron is trying to make me feel stupid, successfully.

Next time I buy a new car I will have to verify that it has gear oil in the differential. Because every car on the lot will have shipped with diff oil except the one that I select, and the owner's manual won't tell me that on this very specific model the owner is expected to put it in.

Edited by strantor_

Share this post


Link to post
Share on other sites

From W451:

1.png.3d27bb96ea132b3d970d8bd0ea9bcbb2.p

NO MENTION of fb restriction on string functions

Share this post


Link to post
Share on other sites
On 12/14/2017 at 5:23 AM, strantor_ said:

How frustrating! I didn't see this restriction printed in any documentation before I selected CP1H for this application, and I still don't. I have looked hard through all my manuals twice and I don't see this printed. In CP1L/H Programming manual W451, CX-Programmer manual W447, CP1H operation manual W450, it is never mentioned that I can find! It really lead me to believe it as capable. Omron is trying to make me feel stupid, successfully.

Next time I buy a new car I will have to verify that it has gear oil in the differential. Because every car on the lot will have shipped with diff oil except the one that I select, and the owner's manual won't tell me that on this very specific model the owner is expected to put it in.

Well... if you go to CX-Programmer Help-->Manual--> Function Block/Structured Text Part, you'll find this on page 147.
The CP, CJ, CS manuals only talk about ladder instructions. Omron kept the Structured Text manual separated as a single manual for all PLC since it was implemented after initial series launch.

Capture.JPG.e44385d3495e11f0706892f96b3f

Share this post


Link to post
Share on other sites
23 hours ago, innoaloe said:

Well... if you go to CX-Programmer Help-->Manual--> Function Block/Structured Text Part, you'll find this on page 147.
The CP, CJ, CS manuals only talk about ladder instructions. Omron kept the Structured Text manual separated as a single manual for all PLC since it was implemented after initial series launch.

 

Thank you.

I did come across that later, but I still feel somewhat justified in being irritated with Omron on this matter. That little blurb that you circled is only half-way informative. It is the only mention anywhere in any of the manuals, and it doesn't come close to saying "CP series cannot support ST instructions for String type."

I understand that the ST function came after the release of CP1H, but can Omron not create a manual revision covering CP1H ST instructions?

And if they're not into revising manuals, how am I to know that the circled blurb is even current? Maybe the manual came out before CP1H? I don't know the timelines of these things.

This should be spelled out in bold, in a logical place that someone would look for it if they were considering purchasing it for their application. Like in the datasheet released may of this year, page 1, Features, 8th bullet down,  where it says " • The structured text (ST) language. Makes math operations even easier ."  Maybe instead it could say " • The structured text (ST) language - Partial Support. Makes math-only operations even easier. (See W451 Rev 2017 section 5 - Structured Text)" - and then actually release a new W451 with a section on structured text.

 

Anyway, rant over. Thank you for your response and I'm sorry if my reply seemed negative. I'm still a little butthurt.

I'm moving on though. The CP1H is in pieces in the bottom drawer of my cabinet, and I have a CJ2M on the desk now. This one DOES support string. All good now (except the money).

Edited by strantor_

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