TCP/IP Ethernet communication on PLC - simulation

I try to connect an Omron PLC (CP1L) to a PC through an Ethernet Option Board. I have setup connection correctly and is able to connect to the PLC to configure its IP and various settings.
Then I have problem getting the ladder program to run correctly.
Documentation indicates address A202.00 will turn on when communication is enabled, but when I simulate the ladder program, the address A202.00 always turn ON. Even when I disconnect the Ethernet cable, the address remain turn ON. I do not understand why the address remain turned on even there is not ethernet cable connecting the PLC and the PC.
Simulated ladder program indicates A202.00 always turn ON:

If you have the physical PLC then why are you running in simulation? If you want to debug the real system just plug into it with a USB cable and use "PLC -> Work Online...". I don't think networking simulates exactly right since the simulator itself uses simulated networking to work. In any case, if you are running in simulation then the state of the real ethernet port on the real PLC will have absolutely no impact on the simulation. It doesn't care that you even have a real PLC at all.
In any case A202.00 is just a "Port not busy" flag. You use it to guard rungs against trying to read/write from the same port at the same time or to trying to perform multiple simultaneous reads or writes. A202.00 is ON so long as the com port is not busy. If it is reading or writing then the A202.00 will go OFF for the duration of the read or write, preventing other communication rungs guarded with it from executing, and then returns to the ON state.

Related

How to send data from STM32 USB port to Raspberry PI USB port?

I want to send data through USB between STM32 and Raspberry Pi. I don't want to use USB to Serial convertor, but instead have a actual USB Connection (maybe CDC class). I have to send data at high rate (Full speed). Please guide on how to achieve this?
A USB-serial connector is simply a microcontroller implementing a USB CDC/ACM virtual COM port and bridging to a UART which you would connect to a microcontroller's UART interface.
In your case you can simply implement the CDC/ACM directly on the STM32 using either of its USB device controller peripherals (USB support varies depending on the specific device https://www.st.com/resource/en/application_note/dm00296349-usb-hardware-and-pcb-guidelines-using-stm32-mcus-stmicroelectronics.pdf).
How you actually implement that will depend on what specific part, and what library or framework ecosystem you are using (e.g. SPL, CubeMX, Mbed). There are reference implementations, examples, drivers and libraries for all of these.
Your milage may vary, but I have measured ST's own USB library and example CDC/ACM virtual COM for STM32F1xx on a 72MHz MCU achieving 700kbits/s. Note that the performance is independent of the baud rate you might set on the host when you open the he VCP. Setting the baud rate simply sends a control packet to the device that can be used to set the baud rate of a UART in bridging applications. In your case such control packets can be ignored. There are similar packets for modem control signals such as DTR, RTS, CTS and RI, which you might choose to us for flow control or other signalling.

I have data streaming into a PCIe port, how best to save it directly to a remote drive connected through a 10GbE port?

Data will be arriving at a moderate rate of 30MBps from an external device through a PCIe. I want to move the data immediately off of my acquisition machine and store it on a remote drive on a server. My acquisition machine is connected to my server on a 10GbE line.
What happens in between when my data arrive on my PCIe and when it leaves on my ethernet card? Any tips on how to design my system? Any special hardware needed?
First time poster, long-time listener
----edit----
input is arriving through kintex 7 eval board (https://www.xilinx.com/products/boards-and-kits/kcu105.html)
using the xillybus drivers (http://xillybus.com/) to communicate with an FPGA
output is moving to a TRENDnet 10 Gigabit PCIe Network Adapter
I have design choices about whether it will be a Windows or Linux machine.

How Can I send AT commands to GPS module connected to a raspberry pi

My GPS module doesn't automatically turn on its GPS to receive data. The module uses AT commands to turn on GPS and the the GPS shuts down when you remove it from its power source.
The problem is I can turn on the GPS with PUTTY serial monitor when connected directly to my laptop for testing, but I don't know how to turn it on when connected to my raspberry pi because I don't know how to send the AT command through the raspberry pi to power it up.
Is there a way i can send AT commands to a connected device on my raspberry
I have tried the cu method but it doesn't seem to work as I receive no response when I input the AT code
So if I understand it correctly, you can connect the GPS module to your laptop directly and send the AT commands to it but, you are unable to do the same with your RPi.
Think of it like this, how is the computer being able to send the AT commands? Through a UART right? So that means you need a UART like connection between the 2 devices to be able to send AT commands.
Now, lets just replace the computer with the RPi, again you would need a UART connection between the GPS module and the RPi module, lets say a simple RS232 connectivity. Once you have this connection established, you will have to program your RPi to send the appropriate commands to the GPS modem via this connection. So probably what you need to google now is "RS232 communication using RPi". And of course you will need the Tx and Rx connections to be proper between the two devices.

Communication Between ESP8266-01 and NUCLEO-F030R8

I've been tasked with figuring out how to get a mobile app to communicate with an MCU then in turn control a stepper motor. Right now I'm trying to get the WiFi module (ESP8266-01) and MCU (NUCLEO-F030R8) to play nice with each other. The catch is I have little to no experience and no education in this field. The closest experience I have is simple Arduino sketches from years ago (IE photo-resistor values driving a stepper motor) and making desktop applications with C#. I am using STM32CubeIDE but if there's a better option I can switch to that.
What I would very much like help on is send and receive simple data between a smartphone and the MCU via the WiFi module. I've read through documentation and other questions but still don't exactly know where to start.
I understand this is probably a large topic in its own right and a short blurb on the internet won't do it (and undoubtedly its multiple subcategories) justice. But I might as well ask.
Sorry if this is too much and thank you in advance.
This project would involve making the following connections.
The UART connection between STM32 and ESP8266.
The WiFi connection between ESP8266 and the mobile.
The application layer protocol between ESP8266 and the application running on the mobile.
For 1, you can actually program the ESP8266 using Arduino IDE and simply connect the UART TX/RX pins of ESP8266 with RX/TX pins of STM32 respectively. You can create a test project in which ESP8266 sends data to STM32 over UART to verify this connection.
For 2, you need to consider the wifi network mode i.e identify whether the wifi connection is going to be ad-hoc (mobile connects to ESP8266 directly) or in infrastructure mode (mobile and ESP8266 connected via a shared access point). You can configure the ESP8266 in both modes. You just have to program the SSID and password of the Wifi network in the ESP8266 (in case of ad-hoc, it is the SSID of the network advertised by ESP8266 and in the infrastructure mode, it is the SSID of the common AP). This wifi functionality is also easily programmable in Arduino IDE for ESP8266.
Finally, once the physical connection has been established between the ESP8266 and mobile device, you need an application-level protocol to connect the application running on the mobile with the ESP8266. You can either use socket connection between ESP8266 and mobile application or use a higher-level communication protocol for IoT devices like MQTT, which is also available in the Arduino IDE.
Final connection diagram could be something like this:
application -> mqtt msgs -> wifi packets -> esp8266 recv pkts -> parse mqtt msgs -> forward data to STM32 over UART

rs232 to ethernet converter connection issue with Atmel board

we are doing a project for receiving data from a device using a RS232 to ethernet converter (gridconnect net 232+) onto to a Atmel board. When we connect the converter to the PC, we are getting the output but not when connected to the microcontroller board. We need to know if there has to be some network confirguration to be done on the converter in order to receive it on the microcontroller.
Thanks !
I haven't worked with that board or device, but with any RS-232 communication channel you should check that all RS-232 parameters are set up correctly on both sides. Databits, stopbits, parity settings, etc. Even one setting being off will completely stop RS-232 communications.
Once that is done, I'd hook up a terminal emulator of your choice to simulate the microcontroller side and make sure that you're getting the right traffic from the Ethernet side. You might get lucky at that point and everything might start working. ;)