Heeyy all! I have one question. I conected sensor distance to IRC5 controller when i want write program Rapid read string Analog of sensor. How can i used ?
write code Read string Analog input from sensor distance?
-
mrvanphuong -
January 3, 2019 at 10:51 AM -
Thread is marked as Resolved.
-
-
An analog sensor should be sending voltage or current. What do you mean?
-
An analog sensor should be sending voltage or current. What do you mean?
An analog sensor should be sending voltage ! -
Technically an Analog sensor could be both, but - you're using a sensor tied into an analog I/O measuring volts (or distance in your case).
You could (should) change the logical min/max values in the analog configuration to match that of your sensor, i.e. if 10V represents 300mm you set your your logical max to 300.
As for presenting it on the teach pendant you need to convert the sensor value to a string, i.e.
TPWrite "Distance="\Num:=aiMyDistanceSensor;
or, if you want to get fancy...
TPWrite "Distance= "+NumToStr(aiMyDistanceSensor,2)+" mm.";