In the first picture you are writing to an M address, then you show the indicator linked to an HMI tag which is synchronized to a DB tag. Separate memory locations.
It looks like on the HMI it is in format 9.999
I think you need to change it to format 99.999
Is Laser 2 working? Maybe copy the field from Laser 2 so you can copy the format
YES!!!!!!!!
At last, it's working thanks to your help!
Yes, sorry @LD_AR2...I used the M-references because I was following an online tutorial and the presenter was using M-references.
I am a newbie at S7 to please excuse my ignorance.
Anyway, I updated the code as per the picture attached, recompiled, and it's working now.
Great help on this forum.
Well where are you getting the values from? no need to write %md and then to the db registers. can use the Direct input registers from the sensors. Unless you want to manipulate the read value
Well where are you getting the values from? no need to write %md and then to the db registers. can use the Direct input registers from the sensors. Unless you want to manipulate the read value
Sorry I don't understand this comment due to my lack of S7 experience. However, to add info, md8 is the result of reading the raw value analogue input, then norm_x and scale_x, resulting in a laser distance measurement in millimetres.
Yes define them in DB, you could also move the raw value into a DB location.
Also you might consider putting a P_Trig (One shot) instruction after the save value, as right now you overwrite the save value every scan the input from the HMI is true.