petchpetals
-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Events
Blogs
Downloads
Articles
Media Demo
Posts posted by petchpetals
-
-
I used an ethernet cable to connect the PLC with the Raspberry Pi. I will try with the new IP Address setting next time I go to the university.
I have set up the HW configuration and paired each analog input with an MI but I wasn't sure about the wiring. I have just found this data sheet about the wiring of V430 model (in attachment). My collegue told me that the level sensor is wired with input 9 and the temperature sensor is wired with input 10. Does that make sense ? because according to the data sheet, it looks like inputs 9 and 10 are only for digital input or temperature sensor and it looks like both input 9 and 10 are supposed to be wired with only one analog sensor, which would be AN0 in the HW configuration (if I understand correctly that #0, #1, #2, #3 on the data sheet correspend to AN0, AN1, AN2, AN3 in the HW configuration?) or am I misunderstanding something? I didn't take a look at the wiring myself. I will have a look again next time I go to the university.
-
Thank you for your reply
I just had the chance to test it at the university today but I had quite a few problems and could not connect the PLC to the RPi via Ethernet yet.
1. Could you tell me how to assign the IP address to the PLC in "TCP/IP - Carn Init" block. How can I know what I should insert for IP Address, Subnet Mask and Default Gateway?
2. When you pair an analog input with a register in "Hardware Configuration", how do you know which Nummer belongs to which input? In my case, my sensors are connected with input 9 and input 10. There are four rows for analog inputs in the "Hardware Configuration". The first two are for temperature sensors (T/C, nV, PT100, Omhs) and the other two are for regular inputs (4-20mA,...)
-
Hello,
I'm very new to PLC programming. This is my first practice. I'm doing a small project for my university. We have a Vision430 controller that is already connected to a temperature sensor and an ultrasonic sensor for level measurement. I have to program the V430 and a Raspberry Pi, so that the RPi can access the sensor values via MODBUS IP. I have watched the tutorial videos and tried to write the ladder logic myself but am not sure if it's correct and I haven't had the chance to go to the university lab to test it with the controller yet because of Covid-19. Could you please check the program I wrote?
And about the program for Raspberry Pi. I have to write the register addresses of the V430. I use MI1 and MI2 for the values from both sensors. Does that mean that the register addresses are 40002 and 40003 respectively?
Thank you for your advice in advance.
Using MODBUS IP to get values from sensors through Visilogic to Raspberry Pi
in Vision & Samba PLC + HMI Controllers & VisiLogic Software
Posted
The connection with Modbus was successful today! Thank you for your help!
In case it might help someone, I used PyModbus library for the Modbus communication between my Raspberry Pi and the PLC.
To read a 5-register long vector starting at MI3, I use the command
client = ModbusTcpClient(host= '#IP address of the slave PLC#' , port=502)
rr = client.read_holding_registers(3, 5, unit=2)
print(rr.registers)
So the address you have to write in the command is simply 3 for MI3. I don't know what unit=2 means but the programs will have an error if this part is left out. Other numbers for example unit=1 seemed to work too.
As for the inputs, I noticed another picture on the same data sheet today. I thought that numbers 1-15 on the PLC are numbers of the inputs but I misunderstood. I though my sensors are wired with inputs 9 und 10 but they are actually wired with Inputs I6 and I5, which correspond to AN2 and AN3 respectively.