Insert Sensor Photoelectric but not recognized

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.

Re: Insert Sensor Photoelectric but not recognized

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.

Re: Insert Sensor Photoelectric but not recognized

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.