Hey guys, I followed the example here in this post Analog Voltage Output Mode but it didn´t output any signal.
If I use the debug mode it shows how there is indeed a value stored in the variable but the output remains at zero volts, does anyone knows what I am doing wrong here?
This is the code in question:
OUT1 := OUT1 + 10;
IF OUT1 >= 8191 then
OUT1 := 0;
END_IF;
// To define a specific voltage use the method below:
// OUT1 := <Voltage> * 8191.0 / 11.0;
This requirement appears in multiple sections of the tutorial, specifically under Analog Voltage Output Mode, Analog Current Output Mode, and PWM Output. The exact phrasing in each of these sections is:
To make sure the runtime can comply with the Analog Expansion actions programmed, modify the task speed by right-clicking in Task > Fast then clicking on Task configuration and setting the Fast task period to 50 ms.
Explanation
Default Behavior: In the Arduino PLC IDE (used for programming the Opta), tasks are organized into cyclic executions. The "Fast" task has a default cycle period of 10 ms, intended for time-critical operations.
Required Change: When using the analog outputs (O1 and O2) on the expansion module, you must increase the Fast task's cycle period to 50 ms. This is not a switch to a separate "Slow" task (though the Opta supports a Slow task for less critical operations); it's an adjustment to the Fast task's timing.
Why This Is Needed: The analog output operations (e.g., voltage or current DAC modes on O1/O2) involve actions that take time to execute reliably in the runtime environment. A 10 ms cycle is too aggressive and can lead to issues like the PLC application entering a "NOT RUNNING" state (as noted in related Arduino Forum discussions) or inconsistent output behavior, because the system can't complete the necessary updates within that short window. Setting it to 50 ms gives the runtime sufficient time to process and apply changes to the outputs without overload or errors.
Hello, I appreciate the detailed steps listed in the latest post. I have read through all seven posts and tried all the suggestions, but I am still having difficulty with the analog output using the Opta with the analog expansion module. But my trouble is that I am not able to change the period in the task configuration settings. It seems to be locked from editing.