Jouni_K Posted February 8, 2013 Report Posted February 8, 2013 Hi you all. I know this might be very easy and stupid question but I'm not familiar with OMC PLC programming ...especially with protocol macro. I'm using CJ1M(CPU11) and serial unit SCU21. So my task is to send stuff from PLC to label printer by using protocol macro. My question is how-to convert HEX to ASCII ? I mean if I will store HEX value etc #04D2 in DM1000, so how to make it visible as a ASCII string in printer. Now I can not see there any ASCII marks, only HEX. I know the conversion should be happened by using PMCR "First send data and send area" but now after trid it many many times, it's still not converting anything. I'm trying to send the content of D916 and D917 to serial port as ASCII. Content of D916 is "1234"(as HEX 04D2) and D917 "5678" (as HEX 162E). In a "send message list" the data string looks like "{PV03;0020,1868,0196,0098,H,00,B="+(R(DM 0916),8)+"32586|}. But how to configure PMCR's "First send word" part? Br, Jouni
gtsuport Posted February 8, 2013 Report Posted February 8, 2013 You need to load the hex values for the ASCII characters. There will be two ASCII character per D location. For example, if you want to print 1234, this will require two D locations, if starting at D916 D916 = 3132 D917 = 3334 Please see the attached chart for the conversion information. Hope this will help.
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