Sign in to follow this  
Followers 0
OdinPT

Connecting Scanner To CJ1M with RS232C

32 posts in this topic

Hi, yes exactly... sorry for my Noobness... I was forgeting that since i was trying to get the value to (..) lol... Now i want to controll the sequence, i want to say (for example in the picture) if the actual value in D500 (A) 038 is = to the value in D600 (B) 037 +1 sequence OK. The 3 first numbers are the sequence controll i want to controll that after each reading... what way to do this you advice me ?

Share this post


Link to post
Share on other sites
In order to compare these 3 digits to a certain value you must use the MOVD instruction to get them in the right consecutive place in a word. The comparison needs to take place after the RXD. See attachment for instruction use. MOVE_DIGIT.pdf

Share this post


Link to post
Share on other sites
Hi, I've been trying to move the data i need to other word but it seems something is not right... i have seem the instruction help and i think im doing the correct thing

Share this post


Link to post
Share on other sites
Let's see what you are doing now. For example if the source word contains a value of #1234 hex. So from the source word you are moving digit 3 (the 4th that is!!) and digit 4 that doesn't exist so digit 0 is included, 2 digits in total (value #14) to destination digit 3. As digit 3 is the last rightmost digit, the 2nd digit is moved to digit 0. I also notice you have declared the destination word as integer ? Try to set the monitor type for the source and destination word in a MOVD instruction the same. I would declare the D701 as Channel in the symbol list. What do you want the MOVD to do. See if you can translate that into the control word using the instruction above.

Share this post


Link to post
Share on other sites
Hi, Thanks, so i have changed some things... now what i have is in the picture below... I think that its ok to start the control, my 2 principal problems are: 1) What can i use each time that there is a reading, something like, if D700 <> D800+1 (in the picture example D700 = 37 and D800 = 38) activates a error output... how can i compare the word to validade the integer value i want to control ? can i say for example "if the value integer in the D700.1 <> value integer in D800.1+1 " 2) The first reading from the scanner the value appears in the in the D500 the others in the D501, you know what could be happeing ? Edited by OdinPT

Share this post


Link to post
Share on other sites
The way you are using the MOVD instructions you might as wel use ordinary MOV instructions. The control word #0300 means First digit in source = 0 Number of digits to move = 4 First digit in destination = 0 To be able to compare if the D700 <> D800 + 1, you first need to get the data you want to compare in one word. In your example D501=03, D502=70. To get the value 37 in D700, use the following control words: The same goes for D601 and D602,result to D800 Now you can add D800 by 1 and use the compare instruction and the Not Equals flag CF001 to compare thev values and generate the error. This code means you always have to start with a good number reading, because you will use it as a reference for the rest of the readings.

Share this post


Link to post
Share on other sites
Ok, Thanks for all the help, in my questions principaly PdL, if i now have any more dificulties ill open a new topic since this is starting to move from the principal question that is now solved. Once Agains Thanks a lot to all. Edited by OdinPT

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