andepand Posted October 15, 2019 Report Posted October 15, 2019 Hi, I can’t find an answer to the following and I was advised to ask it here.I’m programming an Omron CJ2M with an MD212 high speed I/O card. I usually do all my programming in Structured text, simply because I like it a lot over ladder or sft.Now, if I want to read the hight speed counter (incremental encoder), I have to make a ladder section and use the PRV instruction to store the present value in a chosen location.The manual says the current PV is stored in A271, but I can’t get a readout there. Apparently the only way to read it is through this instruction.Does anyone know if there is an equivalent to the PRV instruction for Structured text? or another way perhaps? Again, when I check the actual memory adress, there’s no value there withouth the use of the PRV instr.
Michael Walsh Posted October 16, 2019 Report Posted October 16, 2019 The counter value is a double word starting at A270. Monitor A270 as a DINT and you will see the value. A271 would only contain the most significant bits and would only change when the counter exceeds 65535. I believe that you do not need to use the PRV instruction to update this address if everything is configured and wired properly.
andepand Posted October 18, 2019 Author Report Posted October 18, 2019 Thanks for your input, I will check out your suggestion on monday
NevergoldMel Posted October 20, 2019 Report Posted October 20, 2019 You're only the third person I heard ever promote the use of structured text. But that's fine I seem to be the only person for thousands of miles to be able to understand it.
Michael Walsh Posted October 21, 2019 Report Posted October 21, 2019 On 10/20/2019 at 9:08 PM, NevergoldMel said: You're only the third person I heard ever promote the use of structured text. But that's fine I seem to be the only person for thousands of miles to be able to understand it. Structured text is incredibly valuable for specific situations such as calculations and loops, etc. However I find it very tedious for boolean operations and greatly prefer ladder for that case.
andepand Posted October 21, 2019 Author Report Posted October 21, 2019 (edited) Maybe it’s a European thing Like Michael said, in certain cases it’s very useful. In my current project for example, I work with large amounts ascii strings and data set in Lwords, which need to be shifted or moved and referenced in various ways Also I have remote in- and outputs from 40 individual stations for which I use arrays and lots of FOR TO loops and CASE statements to make things easier to implement en modify. In my opinion, once you get the hang of it the possibilities are endless and it’s much less time consuming to write, especially when using loops. Edited October 21, 2019 by andepand
andepand Posted October 21, 2019 Author Report Posted October 21, 2019 Oh and btw, thanks Michael, reading A 270 as a DINT made me recieve some numbers
NevergoldMel Posted October 22, 2019 Report Posted October 22, 2019 I've only used it for creating function blocks for alternate PID equations, odd pump curves, a rather odd pH vs flow equation, and such oddball things crazy P.E.'s come up with.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now