az_max
I copied my LD code from the Arduino PLC IDE to OpenPLC so that I can build an RPI PLC and an Opta with similar code (had to negate a few contacts to get the same results.)
My question is on the built-in RGB LED and button on the Opta.
The LED is:
%QX1.4   Red
%QX1.5   Green
%QX1.6   Blue
The button is
%IX1.0
Both are defined on the same rung, with the logic
 
 
Var
 LED_ON AT %QX1.4  : BOOL;
 Button AT %IX1.0 : BOOL ;
end_var
 
LED_ON := NOT(Button);
 
 
 
I don't have any output on the LED (but the simulation shows it should be on), but I have output on the four green LEDS defined at %QX1.0-QX1.3 (on different rungs on the program). 
 
I'm guessing %IX1.0 is not addressable by OpenPLC?
Reply 0 0
thiagoralves
Addresses are not the same on OpenPLC and Arduino IDE. For a list of default addressing pins on all platforms, check https://autonomylogic.com/docs/2-4-physical-addressing/
 
Also, on the upload dialog you can change the pin mapping according to your preference under the I/O Config tab
Reply 0 0
az_max
I'm getting the input and output info directly from the Arduino PLC IDE for the Opta.  The 4 green LEDS work, an they're %ix1.0-ix1.3.
On the RPI, I'm only using the outputs to drive relays. I thought it would be nice to have the Opta show the output on it's built-in LEDs.
 
button input.pngled output.png
Reply 0 0
thiagoralves
The LEDs associated with the relay outputs light up when the output is activated on OpenPLC. There is no individual control of the LEDs. The RGB LEDs also are not controllable from OpenPLC, but I guess this is an easy fix on the Opta driver
Reply 0 0
thiagoralves
If you want to take a look, the driver is located at OpenPLC_Editor/editor/arduino/src/hal
Reply 0 0
az_max
The LEDs associated with the relay outputs light up when the output is activated on OpenPLC. There is no individual control of the LEDs. The RGB LEDs also are not controllable from OpenPLC, but I guess this is an easy fix on the Opta driver
Well, that explains the 4 LEDs working 😃
Might be nice to have the button and LED working
Reply 0 0
wadskie
I am a newbie to the Opta and had loads of issues with the new PLC-IDE ver 1.0.7 installed on a Win 10 VM in VMware workstation 17. I am running the latest version of OpenPLC editor (downloaded 09/17/24) for Linux on Ubuntu 20. When trying to setup the physical IO variables they are always yellow with red text and error on the compile. I have followed your Opta guide A0-7 and D0-3 in the physical IO section (default). Ive tried putting in the % and leaving it out. Ive tried %IX0.0 and %QX0.0 neither work all combinations act the same. I can download a LD POU just fine with NO physical IO. Any help would be appreciated.
Reply 0 0
thiagoralves
Can you provide screenshots of what you’re trying to do? I have the impression you’re trying to write locations at the wrong spot.
Reply 0 0
fg71
I'm guessing %IX1.0 is not addressable by OpenPLC?
If you use this address in OpenPLC its means you have other 8 input before in I/O config tab. In your case the number 1 is the address and 0 is the bit.
It takes 8 bits per address. So %IX0.0... %IX0.7 = address 1 and 8 memory bits (0 - 7). Its means you need to configure 8 inputs before your input in the I/O config tab. You count the I/O config tab from left to right. The number is Arduino Pin number or GPIO number.
 
ex.
 
If I have 2, 3, 4, 5, 6 as Digital Inputs in the I/O config tab its means I could use %IX0.0 -> %IX0.4. If you like to use pin 4 it will be %IX0.2
The reason its %IX0.2 is the bits start at 0 and not 1
 
From the Opta board library I could see in the header that LED_D0 is unsigned int of number 7. So I guess it would be possible to have 7 as Digital Output and use that to simulate a blinking led.
 
YOUR_PATH_TO/Arduino15/packages/arduino/hardware/mbed_opta/4.1.6/variants/OPTA/pins_arduino.h
Reply 0 0
Reply