Cancel
Showing results for 
Search instead for 
Did you mean: 

Insert Sensor Photoelectric but not recognized

Experimenter
Experimenter


I insert the photoelectric sensor with an API, but the sensor is not recognized, if I restart the PS it recognizes. Is there a command to recognize the sensor? I enter as txcomponent and it is set to lightsensor.

sensor.PNG

4 REPLIES

Re: Insert Sensor Photoelectric but not recognized

Experimenter
Experimenter

What command is used for "Create Photoelectric Sensor" ?

Re: Insert Sensor Photoelectric but not recognized

Siemens Genius Siemens Genius
Siemens Genius

hi,

 

the command is in c++ , and its name is:

<NativeCommand CLSID="{82A64F24-B386-4914-8B99-D786D50CA18F}"
Name="CCCoPlcNewLightSensor Class"
ResourceCLSID="{706ADE44-7028-486D-B9A9-4ED83AA82F11}"
UniqueId="Sensors.CreatePhotoelectricSensor" />

 

BTW, what do you mean by "but the sensor is not recognized"?

can you share your code?

 

 

Regards,

Moshe

Re: Insert Sensor Photoelectric but not recognized

Experimenter
Experimenter

The sensor is in the sysroot I just enter the same but only when I close and open the PS again I can change the functions of the sensor, before neither the signal appears. Code that I use to insert the component.

 

Dim txICCD As New TxInsertComponentCreationData("light_sensor", path)
Dim txComp As TxComponent = TxApplication.ActiveDocument.PhysicalRoot.InsertComponent(txICCD)

Re: Insert Sensor Photoelectric but not recognized

Experimenter
Experimenter

This seems to be a behavior of PS, not just with the API.  If you insert a sensor from an existing component file with the standard Insert Component command, the same thing will happen.  You will need to reload the study before it will be recognized as a sensor.