Jump to content

markw444

Members
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About markw444

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Just as an update, I've put together a basic server that echos any information sent to it and have it running as a console application on port 502 on my PC. I also put together a console client application that connects to this server--I can successfully send information from the client application to the server application. I then tried replacing the client application with one of my Samba 7" units, hoping to see the packets coming through my network card. The Samba sets up the initial TCP handshaking with an address resolution request, to which my PC responds, and then the Samba just continually tries connecting. The connection never successfully occurs.
  2. Thanks for your help Flex. The program does work properly, I pulled a stupid and was relying on what I'm seeing in WireShark--which monitors only the traffic into and out of my PC's network card, not any traffic occurring on the switch. I think I'll have to follow Ausman's suggestion and write up a program to listen on port 502 on my PC. At least I now know the MODBUS master program works!
  3. Hey Flex, I updated the MODBUS configs in the program, but ended up with the same results: the Slave PLC doesn't respond to the master when the master tries connecting its Socket 3 to 172.16.0.1. I've attached new programs/capture screenshot. I apologize if this is something I should be contacting Unitronics for help with--please let me know if it's outside the scope of the forums. Thanks, Mark MODBUSmaster 1902220920.vlp MODBUSslave 1902220922.vlp
  4. Hey Aus, Thanks for the suggestion--I started to implement something along the lines of what you described and then thought I needed to have a PC process listening on the port number (502 for MODBUS) from the MODBUS master logic program--this would allow the TCP handshaking to occur. Not wanting to have to get into writing some code to create a server listening on port 502, I decided to hook two Sambas and my second network card into an unmanaged switch to make a small network. I made up a VisiLogic program for the MODBUS master PLC and one for the MODBUS slave PC, hoping to capture the communications between them with WireShark. For reference, the IP addresses on this network are 172.16.0.0/2. After setting the static IP of my second network adapter to 172.16.0.0, the IP of the slave to 172.16.0.1, and the master 172.16.0.2, I tried capturing the traffic in WireShark with the filter "ip.src==172.16.0.0/24 and ip.dst==172.16.0.0/24". I first successfully pinged and captured traffic to and from both PLCs from my PC and then tried running the read data tables command from the master. Unfortunately, this didn't work--when connecting the socket in my Master's ladder logic, it made a request to the IP address of the Slave for handshaking, but never received a reply. The attached screenshot shows the extend of the communications--two series of pings and the request from the Master. I feel that this may be an error in my ladder logic--I've never programmed a Samba as a MODBUS master before. I've attached both programs with the hope that someone might see an obvious mistake I've overlooked. I appreciate any further help. Thanks, Mark MODBUSmaster 1902220704.vlp MODBUSslave 1902220720.vlp
  5. Hello, I apologize if this question has been answered; I've searched the forum and help files without any luck. I'd like to know where I can find information for MODBUS protocol to read from Data Tables. For context I have about a dozen Samba 7" controllers networked and connected to my PC (MODBUS TCP/IP). I wrote a C# application that pulls data from all the controller bits and registers with the standard MODBUS functions--everything works fine. Up until this point, the logic made minimal use of data tables, so I didn't have a reason to read data from them. Now, however, I need to read Data Table information. There is clearly a MODBUS function block for reading from data tables, but I haven't been able to find any information about the command sequence for this function that would allow me to implement it a Data Table read with a PC master. The "VisiLogic Software Manual: VisiLogic Function Blocks" make brief mention of the information I'm looking for: "Please note that this is not a standard MODBUS function. Read/Write from Data Tables is compatible with Unitronics' Vision PLC data tables only" Thank-you in advance for any useful information, Mark
  6. Hello, I'm attempting to set up a program for jogging a stepper motor using my Samba 7 unit. I'm using a separate stepper controller because the output from the Samba when creating a pulse train was too noisy for the stepper driver at high output current (motor ran smoothly at low current, jitters at high current). Because I'm not using the Samba to produce the pulse train, I have 4bits to work with when connecting to the stepper controller. The controller will have two input bits for movement--one for running the stepper forward and one for running it backwards. I'd like to have multiple settings on the Samba for controlling how far the stepper moves a translation stage. I've setup a data table with strings and corresponding timers for the various run times to store settings. I can store and update strings in the data table, but I'd like to run a timer while the user is running the motor forwards or backwards. My questions are: how can I time how long a user presses a button, and can I do arithmetic with the timer values, and how can I store the timer in the data table (the same as how I'm currently doing it with strings?). Tl;dr How can I time how long a button is pressed, can I do arithmetic with timers, and how can I store the timer in a data table. I apologize if these questions have been addressed in previous forum posts that I might not have found when searching for answers. Thanks, Mark
  7. Thank-you for the replies! I can now read the correct values from the MLs, but only if I query using a start address of 28672. The ML I'm attempting to read from is ML 3, which I would suppose would start at 28678. As a random test value, I set ML 3 = 73333. If I send a MODBUS query for registers starting address 28672 and length 10 (00 03 00 00 00 06 80 03 70 00 00 0a), I receive a response indicating register 28678 = 1e 75, and 28679 = 00 01, meaning that ML 3 = 00 01 1e 75 = 73333. I'm using both WireShark (which recognizes MODBUS commands/replies) and my own C# program to interpret the slave response. This matches what I expected. However, if I send a MODBUS query for registers starting at address 28678 and length 2 (00 03 00 00 00 06 80 03 70 06 00 02), I receive a response indicating registers 28678 and 28679 are zero (ML 3 = 0). I can simply parse the data as necessary, but I wonder why this occurs. Again, thank-you!
  8. Hello, I've successfully connected a small network of Samba HMI/PLCs, and have had my computer running a program to pull data through MODBUS TCP (computer is master, all Samba units are slaves). I can successfully pull data from any of the 256 MIs as their indexing starts at 0 in regards to function code 3: read holding registers. However, I need to pull data from one of the memory long values. I could copy the data into two MIs (as suggested on another forum post), but I would prefer not to in order to limit register use for future changes to my ladder logic. The help files list the starting pointer value for MLs as 5100 in Standard Vision products, but I could not successfully pull data using this as a starting address in my MODBUS commands. I have tried finding documentation regarding this question, but I may be searching in the wrong place. If anyone knows the starting index for memory long values in Samba units, I would greatly appreciate that information. Thanks, Mark
×
×
  • Create New...