Sign in to follow this  
Followers 0
manowar

Masive Hex to ASCII comversion

9 posts in this topic

I need to conver from hex to ASCII more than 1000 DM locations. It is simple to conver some locations with ASC(086) command, but I'll be out of steps if I want to convert 1000 DM locations one after another. Any good ideas? I need conversion all the time and program must do a lot of other things too. I have CJ1M CPU11. Thanks

Share this post


Link to post
Share on other sites
What PLC are you using? What are you sending the ascii to? Need more info.

Share this post


Link to post
Share on other sites
As I wrote I'm using CJ1M cpu 11. I need this because I'm communicating with opto 22 and opto work with ascii not with hex.

Share this post


Link to post
Share on other sites
Hello manowar, You could always use the FOR / NEXT instructions. Then use just one ASC instruction with indirect addresses (incremented with each FOR / NEXT iteration) as pointers to your Source and Destination words. Hope this helps Regards anonymous

Share this post


Link to post
Share on other sites
Are you trying to send commands to the device? If the information you are sending is something that is mostly constant you could just format the section of memory to be ascii text instead of hex... I store text strings all the time in memory. I have been looking, but I cant find a part number ( if there is one) for an ascii unit. That may also be another option. anonymous has a good option also.

Share this post


Link to post
Share on other sites
I allready solved it. If anyone want solution just wrote.

Share this post


Link to post
Share on other sites
YOu can do this with a single ASC instructions by using indirect addressing with incrementing pointer!! Edited by BITS N BYTES

Share this post


Link to post
Share on other sites
I know you said you got it, but I thought I'd throw this out. Maybe you could have used Protocol Macros. That way, you could have input each ASCII text in, and just got out one DM (or possibly two DM's if the string is really long) for each one. Tig

Share this post


Link to post
Share on other sites
You CANNOT use protocol macros on the Serial Port of the CJ1M. They can only be used with an SCB [serial Communication Board, mounted in the PLC] or with an SCU [serial Communication Unit] added to the PLC Bus. Only TXD and RXD instructions can be used for communications via the Serial Port of the PLC.

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