11-25-2020 10:27 PM
Hello,
After downloading the modbus library, I am trying to modify the "Master on RT target".vi and "Slave on Desktop".vi so I can implement modbus ethernet communication between my Crio-9057 and Arduino due but am running into problems. I am very new to Labview and could use guidance on how to break the problem into steps. Is there anyone who can guide me step-by-step here with/without examples to establish communication between my two devices? The master will be the Crio and the slave will be the arduino which has an ethernet shield. Basically, all I want to do is to for the Crio to read a variable from the Arduino and display it in my VI. I would love it if someone could help me understand the fundamentals and hope this post can beneift others as well who are new to modbus communication.
I`ve attached my current project but am getting an unknown error which I do not know how to resolve, I was just trying to read register values in my Master.VI file
11-25-2020 10:51 PM
Your Master on RT is trying to open up a connection to "localhost" which basically means itself. (At least it does on PC's, I'll assume it also means itself on the real time operating system of the cRIO).
Your PC has a different IP than the cRIO. You should put the PC's IP address or machine name in place of local host.
11-25-2020 11:55 PM - edited 11-26-2020 12:21 AM
Thank you for your repsonse. Is the IP address listed under tools->options->VI server--> Machine access? Entering that Ip address I get error 59?
Btw I am connected via usb to the Crio, not ethernet cable
I am also not using a modbus slave emulator because I thought PC would act as slave through "Slave on desktop".vi
Also, here is my file structure, I placed Master.vi which is a copy of "Master on Desktop.vi" under my Crio so the code would run on the Crio?:
11-26-2020 09:21 AM
Are you saying you don't know how to find the IP address of your own PC?
Open up a command prompt window. Type ipconfig.
11-26-2020 03:53 PM
I was able to find the Ip address but I am getting error 59 above.
11-27-2020 01:10 AM
I may actually consider using the examples attached below which I have been able to get working. I just need to interface my arduino via ethernet to read its registers in "MB Ethernet Example.vi"?
In other words, I want something in the VI master to tell me a handshake is appearing between the arduino and my Crio. Any arduino code I could look at would be helpful as well