Sign in to follow this  
Followers 0
ParaffinPower

Protocol Macro - INT to ASCII

2 posts in this topic

Hi Guys, Wonder if someone can help me out here. I'm deep in a project with enough SCU21's to sink a ship. One of the SCU's is talking to a inkjet printer, and I need to send it a DINT to print. If my DINT is 1234, then I want to transmit ASCII 1, 2, 3, 4. However, I'm using message variable "Variable ASCII" (CX-Protocol terminology) which looks like this $(R(10),8) What this does though is interpret my number as BCD (I think), then convert this to ASCII i.e. not what I'm after. As I see it, my option is to manually convert 1234 to ASCII 1, 2, 3, 4 then send this as a "Variable" (CX-Protocol terminology again). This would prompt me to write a conversion FB which must be useful to others? Or is there some wonder instruction that does what I need? From memory, I can convert DINT to FLOAT, then FLOAT to STRING? And transmit this directly. As I mentioned, I've got SCU's coming out of my ears, so this probably won't be my last question. Thanks, Pp

Share this post


Link to post
Share on other sites
Answered my own question. New type of conversion added in CXP V7.0 within FB's. Talk about good timing! Pp

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