panic mode Posted March 28, 2008 Report Posted March 28, 2008 Is there a way to hardcode string value without resorting to hex etc., something like: L 'Beer Opener' T "Tool".Name
Rod_Hackney Posted March 28, 2008 Report Posted March 28, 2008 Have you tried entering your string data in a DB block and then accessing it that way? Below is a link to a tech note from siemens that might assist you. http://support.automation.siemens.com/WW/view/en/16848975
JesperMP Posted March 29, 2008 Report Posted March 29, 2008 Yes, simply enter it in the DB editor as Rod suggests. That is OK if the names shall never change. Or use SCL. Especially if the strings can change or you have to manipulate them programmatically, then it is one of the cases where SCL makes your life soooo much easier: FUNCTION FC1 : INT VAR_TEMP END_VAR TOOL1.Descr_name := 'Beer opener'; TOOL1.weight := 0.05 ; // kg TOOL1.length := 145.0 ; // mm ; TOOL2.Descr_name := 'Grill palette'; TOOL2.weight := 0.12 ; // kg TOOL2.length := 320.0 ; // mm FC1 := 100; END_FUNCTION
panic mode Posted April 4, 2008 Author Report Posted April 4, 2008 Thank you both. It is done and it works but I'm going to ask boss to allow uprgading S7 (currently using Standard which doesn't have SCL)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now