mdanielswv18 Posted November 6, 2013 Report Posted November 6, 2013 (edited) We have a project using an older A series where we are trying to move ASCII code into a register that is monitored by our laser marker. Basically wanting to send hour and minutes to the laser marker using a code that we came up with for the hour and time. On the Q series we used the following code to move the ASCII characters [$+ D810 D840 D817] this takes ascii characters from the first two registers and places them side by side into registry D817. When trying to do this on the A series we can not use the $+ to combine the ASCII characters because it is not one of the commands. How should we go about carrying this out on the A series? I know there is an [ASC ] command but this will not allow us to comine the two registers. Edited November 6, 2013 by mdanielswv18
Mitsu Posted November 6, 2013 Report Posted November 6, 2013 (edited) Had a quick browse through the manual and i think SADD would do the trick: A-serie manual "addition of character strings", see page 9-51. Hope this helps. Edited November 6, 2013 by Mitsu
mdanielswv18 Posted November 6, 2013 Author Report Posted November 6, 2013 One of the first things that I tried to use was the SADD command because looking thru the manual it looked like exactly what I was trying to do, but I couldn't seem to get the format correct for the registers. It would not take the command no matter how I entered it in. I will read over this section in the manual one more time and see if something clicks that did not before. Thanks for the suggestion.
Mitsu Posted November 6, 2013 Report Posted November 6, 2013 It does seem to be the instruction you're looking for since it seems to work exactly the same as $+ in the Q serie. What software and cpu are you using?
mdanielswv18 Posted November 6, 2013 Author Report Posted November 6, 2013 (edited) GX Developer and the cpu is A2USH-S1 When I try to type in the SADD command, I am trying [sADD D810 D840 D817] and it will not accept it. The only way I can get it to take the command is to enter [leda sadd D810] when it does take that command it will cut off the D810 and make it D18. I am not for sure what the LEDA command does either, in the manual it says it will turn on the led on the cpu. Edited November 6, 2013 by mdanielswv18
Mitsu Posted November 6, 2013 Report Posted November 6, 2013 (edited) Ok, in that case: did you download the manual i linked in my previous posts? Page 9-53 has an example. In the A-serie, you need LEDA, LEDB, LEDC for dedicated instructions to work. See page 3-2 for explanation on what it does. You first need to use LEDA or LEDB (execute at rising edge) to indicate which instruction you want to use. You then need to define the data that is needed for the instruction with LEDC and execute the instruction with LEDR. So basically, it would look something like this in your case (i didn't test it, just looking at the manuals): LEDA (or LEDB if you want rising edge only execution) SADD LEDC D810 LEDC D840 LEDC D817 LEDR Hope this helps. Edited November 6, 2013 by Mitsu
mdanielswv18 Posted November 6, 2013 Author Report Posted November 6, 2013 Got IT! Thanks so much for the help. i was trying to use the help function to view the commands earlier and the manual I have at my desk did not have all of the LED commands listed out. Following your manual you sent me I laid it out like their example specifying each LED section of the program. Thanks again. This forum is great!
Mitsu Posted November 6, 2013 Report Posted November 6, 2013 Glad to hear it works. The dedicated instruction mechanism in the A-serie wasn't the most elegant (or short) system around. In a case like this, for a simple string addition, you need to write 5 lines of code to execute 1 instruction. Thankfully, Mitsubishi simplified this a lot in the Q serie cpu's.
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