DL06 Ascii to Bcd

plc noob

Member
Join Date
Oct 2007
Location
atlanta , georgia
Posts
258
Is it possible to compare an ascii value in an 06 plc to a bcd value entered from an hmi ? or can the ascii be converted to bcd ? And the standard compare functions used . How would this convert to bcd ?
 
I think the AEX instruction will work . But i can not seem to find any setup info for the instruction in the online manuals at the ad website . Anyone here used the AEX instruction before ?
 
As far as I can tell the AEX simply moves portions of an ASCII string from one location to another with various options. it doesn't appear to interpret an ASCII string into a number (like ACI in Allen Bradley). In fact I don't see any instruction which performs this. I have only done this (ASCII -> number conversion) in a BASIC module to pre-process a received string from a barcode reader then sent the processed number to the CPU.

If the string is short enough you could work out a character-by-character work around.
 
bernie_carlton said:
As far as I can tell the AEX simply moves portions of an ASCII string from one location to another with various options. it doesn't appear to interpret an ASCII string into a number (like ACI in Allen Bradley). In fact I don't see any instruction which performs this. I have only done this (ASCII -> number conversion) in a BASIC module to pre-process a received string from a barcode reader then sent the processed number to the CPU.

If the string is short enough you could work out a character-by-character work around.

Thats what I got. You can do CMPV. That will do a direct compare between adress to a specified length. It is a ture false condition. If both groups mztch the SP61 is set to 1.

Someone else may know this better than me but I think I remeber that SP61 is used by several other functions as well so you probaly need to keep that in mind when you use the CMPV instruction.
 
Look in the user manual at the ATH instruction (5-90).
This will convert ASCII from one set of V memory to BCD in another set of V memory.
So if you had 3132 in the source V memory (hex equivalent to "12") it would show up as 12 in the destination V memory in BCD/Hex format.

That should make it easier to compare.
 
Thanks for all the replies everyone . I will test these methods . The ATH instruction sounds like what i need . Because i have to compare the ascii value to a bcd constant entered from an hmi so it must be BCD . Thanks again
 

Similar Topics

Hello all :) I am experimenting with a Barcode reader and DL06 and have created the program that reads in the ASCII code. I have a few problemes...
Replies
5
Views
3,855
Dear Gentlemen/Ladies, I have a bit of a nut cracker here. I am using a Koyo DL06 and a D0-DCM (slot 4). I have some issues with the DCM module...
Replies
10
Views
4,796
Hello All Do any of you have experiance sending and receiving ASCII using Visual Basic and Automation Directs DL06 via com ports. I working on...
Replies
4
Views
4,235
This goes along with the other post I have on here..... I have a DL06 with a barcode reader connected to Port 2. I have the communication...
Replies
1
Views
2,125
I am trying to talk to an intelligent stepper indexer with a dl06 through port 2 with RS422 wiring. The indexer accepts commands in ascii format...
Replies
7
Views
8,825
Back
Top Bottom