I'm currently working on an API, that can read out the current joint values of a selected robot, also the position and orientation of the TCP. This seems to work, i get every data, but i also want to create new signals to each value, so it can be sent to the PLC for monitoring (maybe on HMI, or something). The signal creation would work by clicking a button near the value, that i want to monitor.
Is this possible? I'm trying to create new signals in my code, but i have no clue, how to start it properly (even if i already have all the values i need). The values are double types. I've read, that you can use up pre-made signals in the API, but can you create new ones with a method like this? If yes, how?
Solved! Go to Solution.
You can create new signal by using TxApplication.ActiveDocument.PlcProgramRoot.CurrentPlcProgram.Create* methods.
Example (for PLC input signal):
TxPlcInputSignal inputSignal1 = TxApplication.ActiveDocument.PlcProgramRoot.CurrentPlcProgram.CreatePlcInputSignal(new TxPlcInputSignalCreationData("Input_Signal_1"));
Read/write the signal value by using ITxPlcSignal.Value property:
TxPlcValue val = new TxPlcValue(); val.RealValue = 500.345; inputSignal1.Value = val;