fg71
In this example have been testing on other PLC IDE that work with Arduino Uno.
The software could be download from here: Outseal PLC
 
The online test with the Arduino Uno was not possible but software simulator do work.
 
Here is simple example of Latch Relay
[203128%2F9039110%2Fmceclip0]
 
Here is the PLC IDE screenshot
[203128%2F9039113%2Fmceclip0]
Reply 0 0
fg71
I was interesting to know if AI could make an Arduino sketch to work as Latch Relay.
/*
* This Arduino sketch uses two pushbuttons to control an LED in a latch relay
* configuration. The start button (connected to A0) turns the LED on, and the
* stop button (connected to A1) turns the LED off. The LED is connected to D13
* through a 200 Ohm resistor.
*/

const int ledPin = 13; // LED connected to digital pin 13
const int startButtonPin = A0; // Start button connected to analog pin A0
const int stopButtonPin = A1; // Stop button connected to analog pin A1

bool ledState = false; // Variable to store the state of the LED

void setup() {
  pinMode(ledPin, OUTPUT); // Set the LED pin as an output
  pinMode(startButtonPin, INPUT_PULLUP); // Set the start button pin as input
  pinMode(stopButtonPin, INPUT_PULLUP); // Set the stop button pin as input
}

void loop() {
  if (digitalRead(startButtonPin) == LOW) { // Check if start button is pressed
    ledState = true; // Set LED state to on
    delay(50); // Debounce delay
  }
  if (digitalRead(stopButtonPin) == LOW) { // Check if stop button is pressed
    ledState = false; // Set LED state to off
    delay(50); // Debounce delay
  }
  digitalWrite(ledPin, ledState); // Update the LED state
}
 
Reply 0 0
fg71
Simple hello world in Outseal Studio PLC, if you have Arduino board the coil R.1 is pin 13.
 
[203128%2F9039278%2Fmceclip0]
Reply 0 0
Reply