DennisP
MrPLC Member-
Content count
7 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Calendar
Everything posted by DennisP
-
FactoryTalk View DINT to ASCII conversion
DennisP posted a topic in Allen Bradley / Rockwell Automation
Would someone please help me how to convert an integer to ascii? For example if the output tag is an ascii string, of 3 characters and my numeric input is integer. When user input a value of 5, I would like the input value to be convert and assign to output ascii string tag of "005". How do I set the conversion format in either tag assignment or tag expression? -
FactoryTalk View DINT to ASCII conversion
DennisP replied to DennisP's topic in Allen Bradley / Rockwell Automation
Thanks again for coming up with ideas. I probably will have to implement the conversion/formatting logic in the PLC side in this case. -
FactoryTalk View DINT to ASCII conversion
DennisP replied to DennisP's topic in Allen Bradley / Rockwell Automation
I did use that approach, unfortunately the string input doesn't support left fill zero, as in numeric input, but it does right fill zero instead. For example, input string of "1" will get fill with "100" instead. -
FactoryTalk View DINT to ASCII conversion
DennisP replied to DennisP's topic in Allen Bradley / Rockwell Automation
Sorry for being a beginner but where do I get the expression builder to access and convert PV+ database tag? -
FactoryTalk View DINT to ASCII conversion
DennisP replied to DennisP's topic in Allen Bradley / Rockwell Automation
Thanks. Your logic would work if applies to an AB PLC rung. However I am trying to apply the logic to AB FactoryTalk View Studio for AB PanelView Plus display. I figure there is something wrong with my logic when assigning DINT to String. However I am not sure how to do in an FT View expression -
FactoryTalk View DINT to ASCII conversion
DennisP replied to DennisP's topic in Allen Bradley / Rockwell Automation
I have tried as an expression but it doesn't seem to work. if dInput < 10 then sOutputTag = "00" + dInput else if dInput < 100 then sOutputTag = "0" + dInput else sOutputTag = dInput -
FactoryTalk View DINT to ASCII conversion
DennisP replied to DennisP's topic in Allen Bradley / Rockwell Automation
ASCII tag reads as "5", I would like to format it to be 005, or if numeric input is 15, I would like ascii string tag to read as "015"