Jump to content

Recommended Posts

Hello,

I would be grateful for some help with configuring the TCP/IP connection of the V130 controller. I have the V100-17-ET2 ethernet card in it and I did some initial attempts. So far I can see in the system bits that:

  • SB 141 - card exists = 1
  • SB 142 - card initialized = 1
  • SB 143 - socket 0 initialized = 1 (that's the one I'm trying to use)
  • SB 151 - ethernet status: link = 1
  • SB 153 - ethernet status: rate, 100 mbps = 1

For now I'm testing this right next to my PC, plugged to my home router and I'm trying to get anything to work. Right off the bat I see no DHCP, the card init block just asks me for a static IP. I could configure my router with a static IP for it, but I need the MAC address of the card - which turns out to be surprisingly hard to find. Nothing on the box, nothing in the box, nothing in the VisiLogic documentation that I could find. I found the (undocumented) SDW 22 and SDW 23 operands labeled as MAC Address, but I'm not completely sure how to convert them to a MAC address. What I tried so far is:

  • SDW 22 = 573548024 = (hex) 22 2F A5 F8
  • SDW 23 = 13 = (hex) D

MAC has 6 bytes, so I'm assuming that "D" from SDW 23 actually means "00 0D". I still don't know in which order the operands and bytes should be used to get the MAC address. As things are I'm struggling to do a simple ping, not to mention implementing the FTP operations and printing that I need to do.

Like I said in the beginning - any hints/help would be appreciated.

Link to post
Share on other sites

I think there are a couple of topics that need to be sorted here.

For basic PLC configuration, there is no DHCP.  You type the IP address into the Card Init block and that's what it is.  If you want to specify a different IP address from a screen you can give the block an MI address and it will pull it's IP address from four consecutive registers.

You also MUST use the PLC NAME block if you're going to talk to the PLC from the PC over Ethernet.   This connection uses Socket 1 and port 20256 by default.

18 minutes ago, Łukasz Klimek said:

I'm trying to get anything to work

I'm replying this way because of this comment.  I assume you're not communicating with Visilogic, either.  True?

Your topic is listed as "TCP_RAW".  Are you also trying to use the TCP_RAW block?

Joe T.

Link to post
Share on other sites

Ok, so to clarify - I don't need to connect to VisiLogic, I'm fine with using a programming cable for now (unless I'm missing something obvious about this feature).

My use case - I need to retrieve some files from an FTP server and print labels on a network attached printer. To do that I assume that the TCP_RAW mode is needed (since "MODBUS over TCP" doesn't sound like something I want). I admit that I'm very new to PLC programming, but I'm far from a newbie when it comes to programming in general.

I want to start with the printer, since it's super simple - I have an IP of the printer, I have the port, I need to connect to it (client/master) and send 6 bytes of data to get something printed: "^II^FF". I already confirmed that this works with a python script on a PC, now I want to do the same with the PLC. After I get this to work I can worry about actually printing something useful and having configurable IP addresses :)

First of all I should configure my router to assign a static IP for the PLC, so I need the MAC address - thanks for the tip about Info mode. I noticed it mentioned in the documentation before, tried to click the "i" button and it didn't work, so I just forgot about it. Now I tried again but I long-pressed the button instead and got in - the MAC is 00:0D:22:2F:A5:F8 so I was very close to getting it right.

In terms of the program, I tried to:

power-up pulse -> SET PLC NAME -> CARD INIT -> SOCKET INIT (socket 0, TCP_RAW, client)
MB "should connect" -> card initialized -> socket 0 initialized -> socket 0 not connected -> CONNECT (printer IP, port) -> reset the "should connect" MB
MB "should send" -> socket 0 is connected -> SEND DATA (^II^FF)

I trigger MB's by hand to see it work. The result is that the "connected" bit for socket 0 never lights up.

I have the MAC now, so I'll do more testing probably tomorrow. Also one more idea came to me when writing out the program above - it's possible that I didn't reset the PLC after downloading the program, which would prevent the CARD INIT and SOCKET INIT from running. In hindsight that should've been obvious...

I'll get back to you after my next round of testing, hopefully with good news :)

Link to post
Share on other sites

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