cancel
Showing results for 
Search instead for 
Did you mean: 

Edit sensor via API

Experimenter
Experimenter

Hello,

 

Is there any way to access and edit information related to a sensor using the API?  Specifically I am working with photoelectric sensors, and would like to use the API to access and edit the information that normally is shown in the dialog window that comes up when using the "Edit Sensor" command (i.e., setting detection area and the list of objects to check interference with).

 

Thanks

2 REPLIES

Re: Edit sensor via API

Siemens Legend Siemens Legend
Siemens Legend

Hello Dmar,

 

Currently the API does not expose methods and properties to edit the sensors, the information is read only. The base interface implemented by all sensor objects is ITxPlcSensor. You can check it in the Tecnomatix.NET.chm. Some of the sensors has corresponding classes in the .NET API, for example TxPlcRobotPoseSensor, but the photoelectric one does not have such class. It is represented by the TxPlcSensor.

 

Best Regards,

DianaG

Re: Edit sensor via API

Valued Contributor
Valued Contributor

DianaG,

 

when I access a photoelectric sensor in the Object Tree via the API, it is type TxComponent. How do I cast this to ITxPlcSensor so I can access the Signal member?

 

I've tried the usual method and I get "Unable to cast object of type 'Tecnomatix.Engineering.TxComponent' to type 'Tecnomatix.Engineering.ITxPlcSensor'."

 

Any help would be appreciated, thanks.