The most common is to define a global variable, and then bind to the corresponding variable, for example, I define a Sint type of variable Controlword value is 8, after the definition is compiled, Can be found in the PLC program or more out of this variable (Main.controlword is our definition of output type variable, note that at%q* means output type,at%i* for input type)
Controlword at%q*:sint:=8;
?
Then I double-click on the variable, Linked to find the variable to bind to (you see only a few types show up, because Twincat only renders the same type of Sint variable)
?
The disadvantage of the previous method is not "method", more standard practice is to use the Adswrite function method to write the parameters, rather than binding. Using the function block Adswrite, the preceding parameter NetID can be two single quotes, port if the write NC is 500, the Write plc is 801, the address group and address offset are described below, srcaddr is to write the value, you can use the ADR address function, Let's leave the PLC variable name corresponding to the main function.
?
Mouse over the corresponding variable text box can prompt the current variable indexgroup and Indexoffset can view the address group and address offset
?
After clicking Write, you can see that the online value has been written in 123
?
?
For more instructional videos and downloads, please pay attention to the following information:
My Youku Space:
Http://i.youku.com/acetaohai123
?
My online forum:
http://csrobot.gz01.bdysite.com/
?
Problem Exchange:
qq:910358960
Email:[email protected]
?
?
?
Twincat (Balford Beckhoff) Frequently asked Questions (FAQ)-How to write parameters when initializing