SPDT (ON) - OFF - (ON) Toggle Switches are available at Mouser Electronics. Mouser offers inventory, pricing, & datasheets for SPDT (ON) - OFF - (ON) Toggle Switches.
What I want to do is to create a FB to read the signal of input point when it is given a TAG NAME. For example, if the tag name is 'I_motor_sensor', so 'I_motor_sensor' is send to Read_I_Point FB, then the FB will give the current status back. So is there a way to do this?
Sunh HaoSunh Hao
1 Answer
Yes, you can read the symbol using FB_ReadAdsSymByName block in the DataExchange library. Info here.. It will take more than one scan though, so should be considered 'heavy'.
If you want to read them quickly, create a dictonary of references to the variables of interest to you in an intialisation routine, and access them via their key (which you will use a string for).
There's a TwinCAT3 dictonary class in my freely available library, Intecre Utilities, available here. You could try to adapt that for TC2.
Mark LazzMark Lazz
Not the answer you're looking for? Browse other questions tagged sttwincat or ask your own question.