Recent

Author Topic: PascalScada with two Arduino  (Read 3619 times)

microguy

  • New Member
  • *
  • Posts: 49
PascalScada with two Arduino
« on: November 01, 2021, 03:59:03 am »
I am new on PascalScada. I just added on Lazarus. Now I am trying to figure out how to use it with two Arduino. I could not find any example with Arduino. I would like to use it with two Ardunios on RS485. I have four LEDs and two buttons on each Arduino. Can someone share the code for Lazarus and Arduino that I can send and receive data?

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: PascalScada with two Arduino
« Reply #1 on: November 01, 2021, 05:16:03 am »
While new to PascalScada, you probably know more about it than I do. But I suspect that PascalScada and Arduino don't go together ?  As I understand it it, PascalScanda is about PLC ?

Anyway, what is it you want to do ?  I have some very rushed together code to read data back from a Arduino to my (linux) PC over the serial port. Happy to shared but its rough as guts.

The wiki has a page on Arduino, https://wiki.freepascal.org/Arduino

I 'believe' its possible to make code on your PC that you can transfer to Arduino and run there, never tried it however.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

af0815

  • Hero Member
  • *****
  • Posts: 1289
Re: PascalScada with two Arduino
« Reply #2 on: November 01, 2021, 08:12:30 am »
PascalScada can not work on Arduino. This is no target.

FreePascal is basic on Arduino. No LCL, no gui. Better is to use native Arduino Tools to implement a protocol. Except you are a excellent coder.

Normal you use PascalScada to communikate from a PC to some PLCs to show dataon the PC and Send some simple Commands to the PLC. Man Machine Interface (MMI or HMI) is the correct word for it. Not IPC, InterProcessCommunication is NOT the target of PascalScada.

I think you want to ride the wrong horse, if i look on your posts.
regards
Andreas

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: PascalScada with two Arduino
« Reply #3 on: November 02, 2021, 01:30:12 pm »
On PascalSCADA side use MODBUS TCP driver (if you are trying to talk to your Arduino over WiFi or ETH) or MODBUS RTU driver (if serial wire is used). On Arduino side use MODBUS slave (server) driver and write glue code for 4 leds to act as digital outputs, and 2 buttons as digital inputs. Then put those inputs and outputs in MODBUS register space, and use those MODBUS registers in PascalSCADA. Give 1st Arduino address 1, and 2nd Arduino address 2. That's all.

https://www.pascalscada.com/modbus-rtu-and-tcp/
« Last Edit: November 02, 2021, 01:44:40 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

jamie

  • Hero Member
  • *****
  • Posts: 6091
Re: PascalScada with two Arduino
« Reply #4 on: November 02, 2021, 11:14:21 pm »
or simply install the "LazSerial" and talk directly as a serial stream
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018