Sign in to follow this  
Followers 0
Guest Slick504

5/250 To Zebra Printer

2 posts in this topic

I've been asked to develop PLC code that will allow a test label (first off barcode label) to be printed. The quality dept want to be able to press a button on a 1400E Pview and this will generate a "first off label" from the Zebra printer, this will be used to verify the quality of the text on the barcode label. The PLC is a 5/250, which sends data via an RB module to the Zebra printer, the Panelview is a rack of RIO off the 5/250. I've completed the required Panelview mods, and developed the code in the 5/250.....so far so good!! The problem is that i need to have the current time and date on the "first off label". I've used the internal clock and calendar in the 5/250 for these values. when the quality tech presses the PV button I move these values in to my integer file (which holds all of my fixed / standard "first off label" data) this integer file is FAL'd in to a BTW to the printer, when the label prints, all the text is fine except the time and date fields. I think it is because the time and date values are integers and i need to represent these values in ASCII for printing. How do i convert an Integer to an ASCII value, ready for printing. eg, when i move the time value 14:35 in to my integer file....and then change the Radix of the Integer file to ASCII, it just shows the time and date fields as gobolldy gook...any help appreciated. Thanks in advance. Graeme

Share this post


Link to post
Share on other sites
First off - my condolences for: a) having to work with a 5/250 b) having to work with the dreaded -RB module c) having to work with a PV1400 d) having to have anything to do with bar-codes As for the problem: You need to convert the value 14:35 into a string of ascii characters. My memory of the 5/250 internals are a bit hazy but I believe the hours minutes and seconds are stored in separate integer words in an "S" file. I suggest you convert each to a BCD value (TOD instruction), then for each value move the "tens" digit into the upper half of the word (bits 8-11) leaving the "units" digit where it was (bits 0-3). Now place "3" (BCD) in the remaining 'nibbles' (bits 4-7 & 12-15). That's it! The two digits are now two ascii characters. The ascii codes for digits 0-9 are hex 30-39. You may need to swap bytes to get them printed in the right order.

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