Jump to content

Modbus in RT


task

Recommended Posts

Hi,

I'm a long time labview user but new to using a PXI controller and RT module. Here's my dilemma...

The PXI (PXI-8184) will be connected to a Automation Direct CMore touchpanel via modbus ethernet. No host PC will be present in the end.

I have the PC and the CMore talking via modbus (CMore is the master, PC is the slave). All this works fine. Now I'm trying to write the actual RT code that will eventually run on the PXI controller.

My problem is getting the modbus stuff to work. All the IP addresses and subnet masks are set up correctly. Under my PXI system I set up a ModbusSlave I/O server. It took awhile but I figured out how to set up the shared variables. I tried several different methods but it still doesn't work.

Example: Variable 00001, bind to source ModbusSlave0001, boolean, network published. Is this the direction I should be going or am I off base?

I get a deployment error: Cycle detected (addresses of the boolean).

I just need a nudge in the right direction!

Thanks for any help.

Link to comment

QUOTE(task @ Feb 1 2008, 03:45 PM)

My problem is getting the modbus stuff to work. All the IP addresses and subnet masks are set up correctly. Under my PXI system I set up a ModbusSlave I/O server. It took awhile but I figured out how to set up the shared variables. I tried several different methods but it still doesn't work.

Example: Variable 00001, bind to source ModbusSlave0001, boolean, network published. Is this the direction I should be going or am I off base?

I get a deployment error: Cycle detected (addresses of the boolean).

I just need a nudge in the right direction!

Thanks for any help.

This sounds right to me, but maybe your Modbus addresses are off. You'll have to look at the Modbus spec, but some addresses are for booleans and some are for numbers, and of those, half are for values the master can write and half are for values the slave can write. Are you assigning an address to your shared variable that only the master can write, and then trying to write to it on the slave? I don't know what else that error might mean.

Link to comment

QUOTE(ned @ Feb 1 2008, 04:05 PM)

This sounds right to me, but maybe your Modbus addresses are off. You'll have to look at the Modbus spec, but some addresses are for booleans and some are for numbers, and of those, half are for values the master can write and half are for values the slave can write. Are you assigning an address to your shared variable that only the master can write, and then trying to write to it on the slave? I don't know what else that error might mean.

The addresses are correct and I'm using them the correct way...everything worked fine when I was running the program under My Computer and not the Real Time Controller. I guess this is part of the learning curve on how to use the RT stuff. I moved the modbus stuff into the variables-network-RT(separate).lvlib and the "cycle error" went away but I am still unable to read/write anything. I'm doing what I think is logical and I'm probably missing something huge!

I'll keep plugging away...

Link to comment

QUOTE(David Wisti @ Feb 1 2008, 04:41 PM)

Resolved...I had to change the address of the "PLC" in the CMore. It was set to the PC and not the PXI. I put the ModbusSlave under the variables in the RT area (as I mentioned earlier). Now the PXI and CMore are communicating.

Now I just have to adapt all the code I previously wrote under the PC for the RT system.

Thanks for all the input.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.