Marko Posted October 22, 2018 Report Share Posted October 22, 2018 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 Quote Link to comment Share on other sites More sharing options...
ORSO2001 Posted October 22, 2018 Report Share Posted October 22, 2018 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.