Jump to content
OMRON Forums

Recommended Posts

Posted
I see in V1.3 FIRMWARE UPDATES details of string functions on particular strtod looks useful to me. I cannot get it to work or find any examples... Any advice?
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

Thanks shansen, I did see those as I posted but didn't get around to editing/addig to the post. I could not get them to work. The download said strtod was illegal (I am definitely running latest released firmware/IDE)

 

  • 2 months later...
Posted

Running September release I still cannot get any of the Character Buffer Functions or String Manipulation Functions to work in my PLCs:

 

open plc 1
strcpy(256, "123")
p4 = strtod(256, 0)
close

 

These are detailed in "Power PMAC Script Mathematical Feature Specification.pdf", "Power PMAC Command Summary 2011-08.pdf", and "Power PMAC V1-3 Firmware Additions.pdf".

 

I cannot get them to download, and the intellisense has no knowledge of them. What am I doing wrong?

 

Dave

Posted

These string functions are truly functions, which means they have a return value, which must be "put" somewhere. Your first PLC program line:

 

strcpy(256,"123")

 

gives a syntax error. It is no more valid than

 

cosd(30)

 

as a program line. You need to make it something like:

 

p3=strcpy(256,"123")

 

Function names are not presently included in the Intellisense.

Posted

Thank you Curt. This works perfectly now, and I'm hopeful it could be a possible error reporting/logging mechanism in my project.

 

I guess the 'necessary return variable' is a PLC language feature?

 

My background is more C-type languages where it is acceptable to have lines such as strcpy(str, "123"); where the 'real' work happens in the parameters and you are uninterested in the result. Even cos(30); is a valid (if pointless) line.

 

Thanks again for putting me on the right track, your help is appreciated.

 

Dave

 

Guest
This topic is now closed to further replies.

×
×
  • Create New...