Jump to content

Recommended Posts

Hey all,

I am new to Visilogic and I am trying to follow through tutorials. I am currently trying to interface a single EX-RC1 via CANBus to a V570. On the EX-RC1 I have a IO-DI16 and IO-RO16. I have tried to download the sample Visilogic programs to the PLC, however, I am not entirely sure if I am doing it correctly. 

I have flashed the V570_CAN Master for EX-RC1.vlp on the V570 successfully, however, the screen shows "COMM ERROR UNIT #2". When I tried to download the EX-RC1.vlp to the PLC it says "The PLC model selected in this project's Hardware Configuration conflicts with the model with which you are communicating." 

I am programming through the USB cord to the V570 with a baud rate of 115200. 

Any and all help would be greatly appreciated.

 

Thanks,
Greg

Link to comment
Share on other sites

Hi Joe,

Yes, I have realized this. I have made more strides in becoming more familiar with the V570 and EX-RC1. My current problem not is a problem with communication with the EX-RC1. Before attempting to download the EX-RC1.vlp I attempt to check the connection and get errors. I have the EX-RC1 connected with a CANbus cord between the V570 and EX-RC1 with the EX-RC1 set to 2 on the dip switches. So when changing the communication through the USB cord to UniCAN channel 2, this is where I am receiving the errors. 

Can I program the EX-RC1 through the V570 with a cord between the 'PRG' port on the EX-RC1 to either Port 1, Port 2, or the I/O expansion port on the V570? Also while still downloading from my PC to the V570. 

Thanks,

Greg

Link to comment
Share on other sites

  • MVP 2023

With CANbus working correctly, you should be able to program the EX-RC1 through the V570.  I'm assuming you have your com settings like this when you try to connect to the EX-RC1 via the V570:

image.png.7867d2ac2d309c54e72a46bf22d7b0da.png

With the PC port set to whatever COM port your USB cable is using.

 

22 hours ago, greg said:

Can I program the EX-RC1 through the V570 with a cord between the 'PRG' port on the EX-RC1 to either Port 1, Port 2, or the I/O expansion port on the V570? Also while still downloading from my PC to the V570. 

No.  That doesn't work.

Joe T.

Link to comment
Share on other sites

Yes, I do get to that pop-up window. When I set the Unit ID to '1 (CANbus)' and I click the Get OPLC Information, the V570 information shows up as it should. However, when I change the unit id to 2, I get the pop-up window with the list of errors for CANbus. I do have the DIP switches on the EX-RC1 set to 2. I am not sure why it is not able to establish a connection.

Link to comment
Share on other sites

  • MVP 2023

The -RC1 comes out of the box set to ID 1, but the DIP switch settings in the Unitronics documentation are confusing as it's not clear which is up or down - black or white.

The switches themselves are actually white, but the drawing shows them as black:

image.png.5845ccc7439e796d0d7b4b8838b3746f.png

So ID #2 is switch 2 up.

2 hours ago, sgull said:

Have you supplied 24vdc to the canbus wiring?

Or it could be this.

If the bus is powered and the switches are right, CANbus works.

Joe T.

Link to comment
Share on other sites

I was not supplying 24V DC to the CANbus wiring, so I have fixed that. Thank you Denis. 

I also did have the switches inverted because of how I read the documentation drawings. It is now correctly set to ID 2. Thank you Joe.

I am now able to communicate with the EX-RC1!

Moving forward for programming the EX-RC1 to work with the V570, since I want to use the IO-DI16 and IO-RO16, can I just change the HW configuration in the sample EX-RC1 file to those modules and then create a program for the V570?

Thank you both for all of your help.

Link to comment
Share on other sites

On 4/16/2018 at 10:50 PM, greg said:

 

Greg Hi

I send you my files for PLC & EX-RC1 , First make adress in your extenzion devices and separatly programming each. After that look the programm and make yours aplication programm

and adjust for yours screen in V 560. Joe explained to you how to make address, but programming time  for RC1 is the safest at 38,400 via RS232

Evrything next is very simple.     Good luck

RC TEST V1040.vlp

RC#2.vlp

RC#3.vlp

RC#4.vlp

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hello all,

It has been a while since trying to interface with the RC1 and IO modules. I was working with a snap-in IO module in the meantime. I want to get these modules working as well. I have attached the .vlp files with my adjustment to the EX-RC1.vlp for my application. I am not sure what to be adjusting on the V570 file to be able to actually control the DI16 and RO16. Please advise.

Thanks,

Greg

EX-RC1.vlp

V570_CAN Master for EX-RC1.vlp

Link to comment
Share on other sites

18 hours ago, greg said:

Hello all,

It has been a while since trying to interface with the RC1 and IO modules. I was working with a snap-in IO module in the meantime. I want to get these modules working as well. I have attached the .vlp files with my adjustment to the EX-RC1.vlp for my application. I am not sure what to be adjusting on the V570 file to be able to actually control the DI16 and RO16. Please advise.

Thanks,

Greg

EX-RC1.vlp

V570_CAN Master for EX-RC1.vlp

Here I am returning your corrected application  for PLC , You made a mistake that you wanted to send the output directly in RC it is possible to send DO as MB only

V570_CANMasterforEX-RC1 (1).vlp

1.jpg

2.jpg

Link to comment
Share on other sites

Thank you for your help. I have tried downloading your code to the V570 and still cannot get the RO to trigger. I know the addressing is important dependent on the equation: 32 + (expansion module number) * 16 + (output number).  So in my case I have the RC1, then the DI16, and lastly the RO16. So the first output O1 should be addressed at O49. Please advise.

Thanks,

Greg

Link to comment
Share on other sites

  • MVP 2023

niCAN is hard for a beginner to get their head around.  The first thing to remember is that data can only be sent, not requested.  The Message Arrived block tells us that someone else sent us data.  All data must travel as MI registers.

Let's start simply and not try to use the examples.  They were written by someone back at the Mothership who has a thorough understanding of the UniCAN concept and protocol and implement register offsetting, which is totally unnecessary at your stage of the game.  We're going hard code sending one word in each direction.

You also don't have to use register numbers up in the stratosphere, and you don't have to have the lightning speed of reacting to an output that just changed.  I've found that a 0.1 second I/O update is fine for getting started.

So let's define some simple things for the I/O attached to your RC1:

An image of the DI16 will reside in MI 100.  It is a 16 bit word and the DI16 is a 16 input module.  This is convenient.

The bits to be sent to the RO16 will reside in MI 110.  Same thing.  I like to separate data out a bit, but not too much.

10 hours ago, NOVI said:

 You made a mistake that you wanted to send the output directly in RC it is possible to send DO as MB only

This is not true.  You can use the Struct to map Outputs to an MI.  It's just another memory type.

We'll start with sending the outputs, using the non-hardware existent O160..O175.  Just because they're not on a module doesn't mean you can't read and write them.

In the OUT sub, hang the Struct on the rail and map O160..O175 to MI 110.  BTW, the length is 16, not 8.  The lower half of your module was feeling neglected.

image.png.d6bd3292bc294a67ae5aaf26ee7b525e.png

Use a simple timer pulse to send the output image every 0.1 second to V570 MI 110 to MI 110 in the RC1.  No need to be confusing here.

image.png.82e4a03e0ab3840d8b026458f31599d0.png

For the Inputs, the RC1 will send an image of the DI16 to MI 100. Extract the bits encoded in MI 100 and lay them into I160..I175:

image.png.9097039183cd5ea64fc082333c5a12a7.png

 

Do the same thing in the RC1 except reverse the Struct block operation for the inputs and outputs.

5 hours ago, greg said:

So the first output O1 should be addressed at O49

Um.. the first output is O0 which is O48.  So you're almost right.

 

See if the attached programs make it more clear.

Joe T.

 

 

 

  

 

EX-RC1 JT.vlp

V570_CANMasterforEX-RC1 JT.vlp

 

Link to comment
Share on other sites

Joe, 

Thank you immensely for all of your help! I appreciate you taking the time to fully write out an explanation to what is required out of UniCan and what changes you made. The communication between all of the modules is working flawlessly now. 

Thank you again,

Greg

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...