Sign in to follow this  
Followers 0
paulcoverley@sky.com

serial input string

3 posts in this topic

Hi 

I'm quite new to plc but very new to mitsubishi.

 

I have an input string eg G+002.7 which represents a weight.

I wish to take in the input string then move/convert to int omitting first char,

 

On other plc's i have been able to use a modifier like d200[2] then the no of chars.

How do i achieve this in gx works3

 

Any feedback gratefully recieved

 

Paul

 

Share this post


Link to post
Share on other sites

will this string always start with "G" ?  If so, Change your HMI input to be Float input and just add the G as a prefix visually

If not, then a block move (BMOV) starting at the second register of your string address would drop the first characters. 

Edited by WattUp
if not answer.

Share this post


Link to post
Share on other sites

Hi , thanks for your reply - to provide a bit more info please see below images of prog and registers.

From the results recd I'm only interested in D201-D203, however i will need to pick up to + sign ie the 2nd byte of d200.

I want to use the +2307.4 in calculation as a signed integer.

 

Any further feed back greatly appreciated

 

Many thanks

 

Paul

 

prog.PNG

regview.PNG

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
Sign in to follow this  
Followers 0