Jump to content
Sign in to follow this  
Marko

Num to Ascii UDBF problem

Recommended Posts

Hello,
I'm new to Unistream so forgive me if I misunderstood something simple (I use latest UL version and latest firmware on PLC).

I wanted to convert number in string and found out that UniLogic doesn't have Num to ascii function. Not happy, but OK, I found UDFB in samples library and set it up according to my needs. Then I encountered problem : I want to set output string to be 4 characters long, show  +/- sign and pad zeroes to fit 4-char format ('+007' for example) UDFB works fine until I switch PLC off and then ON again.

I noticed that in my ladder progrem UniLogic CHANGES UDFB format (padding)  selection from 2 (pad with zeroes) to 1 (pad with spaces) I cant figure out why UniLogic changes UDFB  input parameter by itself???  Even stranger is that downloaded program "works" until power off.

After power On PLC start to pad "spaces" instead "zeroes" and when I open Unilogic program there is also format in UDFB set back to "1" -pad with spaces. attached pic. UDFB input parameter D should be "#2" for my needs but somehow it comes back to "#1'

 

Thanks for help, Regards,
Marko Kocijan

Share this post


Link to post
Share on other sites

hello Marko,

are you sure that the variable that are you using to set the pad is "retained" type?...othewise at each reboot of the PLC this will take the start value set in its reference.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...