mbiarrambang

Message: Hi everyone,

I'm working on an automatic temperature regulator (HVAC system) using a DHT22 sensor and OpenPLC Editor V4. I’ve encountered a blockade when trying to compare the analogue sensor value with a setpoint.
In this version, when I add an LT or GT block, the first input pin (IN1) automatically snaps to the power rail. Unlike previous versions, I cannot find a separate "Variable Block" to prevent this.

When I assign my variables (Temp_Pin and Base_Val) to the pins while IN1 is still connected to the rail, I get the following compilation error: error: Data type incompatibility for value passed in position 1 when invoking function 'LT'

It seems the block is trying to compare the Boolean "TRUE" from the rail against my UINT variables.
  1. Is there a way to disconnect a pin from the power rail in V4?
  2. Should I be using a 3-pin configuration where IN1 acts as an Enable (EN) and IN2/IN3 handle the actual comparison?
Any guidance on the standard workflow for analogue comparisons in V4 would be greatly appreciated!
Reply 0 0
thiagoralves
Double-click the block and enable execution control. This will make the block get hanged on the rail by the EN/ENO pins.
Reply 0 0
BenB
Is there a way to set the output rail to the OUT of the block instead of the ENO?
Reply 0 0
thiagoralves
Unfortunately no, but there is an update coming soon to the web editor that will allow you to add elements to block BOOL inputs and outputs other than the top ones
Reply 0 0
Reply