daves Posted July 15, 2011 Posted July 15, 2011 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?
shansen Posted July 15, 2011 Posted July 15, 2011 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? Have you seen the exmaple in the mathematical feature specification? ftp://support.deltatau.com/DT-USA/Power%20PMAC%20Documentation/PDFs/Software%20Reference/Power%20PMAC%20Mathematical%20Feature%20Specification%202011-01.pdf Check out the bottom of page 72.
daves Posted July 15, 2011 Author Posted July 15, 2011 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)
daves Posted September 28, 2011 Author Posted September 28, 2011 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
curtwilson Posted September 28, 2011 Posted September 28, 2011 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.
daves Posted September 29, 2011 Author Posted September 29, 2011 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
Recommended Posts