News:

  • April 16, 2026, 03:06:37 PM

Login with username, password and session length

Author Topic: PLC to PC Communications  (Read 15544 times)

Bill Cuchinski

  • Newbie
  • *
  • Posts: 6
PLC to PC Communications
« on: November 04, 2010, 03:07:55 PM »
I am fairly new to DirectSoft programming and need to communicate with a PC. Am using a DL260, Port 2 for communications and am using Direct Automation cable to hook PC to PLC. I need to have the PC load a value
of 1 to 14 into a V file (400). They will do this with a hex number. I will need to read this value and activate
logic depending on what the value is. I have no idea how to accomplish this or what commands to use.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: PLC to PC Communications
« Reply #1 on: November 04, 2010, 03:21:57 PM »
If you are using the programming package (Directsoft)and are online with the processor there are at least 3 ways to load a value into a V register from your PC.

1. Open a Dataview window, enter 'V400' as the element. Enable editing, set the type to BCD/Hex, then enter you vlaue as hex numbers (0 - e)

2. Open the 'Change Value' button, enter V400 into the 'element' field, set the type to BCD/Hex. Type in the new value then press the 'write to PLC' button

3. Open 'Tools' - 'Memory Editor'. Use the 'Find' button to change to V400. Select the V400 entry, set the type to BCD/Hex. Type in the new value then press the 'write to PLC' button.

Quote
I have no idea how to accomplish this or what commands to use

Re-reading your question I'm not sure what part of your question 'this' refers to. I hope I answered how to enter the value.
« Last Edit: November 04, 2010, 03:23:35 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.

Bill Cuchinski

  • Newbie
  • *
  • Posts: 6
Re: PLC to PC Communications
« Reply #2 on: November 04, 2010, 03:57:27 PM »
This refers the the value the PC will send to the PLC. I don't understand how the value that
the PC sends is getting into V400 and do I need to move this data to another address to act on it?
What tells the PLC that the PC is putting a value into V400? As you can see I have not communicated with a
PC before. Thanks for your help.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: PLC to PC Communications
« Reply #3 on: November 04, 2010, 04:02:02 PM »
There is no specific signal to the PLC that a value has been entered into the register. The fact that the register has a value, or perhaps a different value than before, is the indication. If a seperate communication is desired to begin the evaluation of the number by the PLC, presumably triggered after the value is written, then that can be done also.

If this would be done by an operator then often a display unit is provided to the operator instead of using a PC.

I'm not sure of you confusion. My first answering post was using the Directsoft programming package which of course writes to the PLC. Are you new just to Directsoft software or to PLCs in general?
« Last Edit: November 04, 2010, 04:04:23 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.

Bill Cuchinski

  • Newbie
  • *
  • Posts: 6
Re: PLC to PC Communications
« Reply #4 on: November 04, 2010, 04:24:14 PM »
I'm new to Direct Automation software and PLC's. I may not have stated my case very well. The machine has
an HMI, a DL260 CPU and in the auto mode will get a value from a PC that has a bar code scanner hooked to it.
Among other things the PC will do, it will tell the PLC what part is being run. There are 14 different parts
and the PLC needs to know what part is running in order to activate the right PLC logic. I'm not familiar with what commands I need in order for this communications to happen between the PLC and the PC.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: PLC to PC Communications
« Reply #5 on: November 04, 2010, 04:37:54 PM »
OK, now it is getting more complex. The barcode scanner is providing a reading to the PC. The PC will automatically, I presume, relay the scan to PLC for operations. We make machinery which has a barcode scanner connected directly to the PLC but in your case I assume the information is also used elsewhere, perhaps for logging the scan.

You will need some type of active program on the PC which receives the scan, preprocessing it if necessary the, utilizing an intermediate communication package, will transmit a value to the PLC. The Directsoft package will not be used for this as it is used primarily to set up the PLC program.

AutomationDirect supplies a communication package KEPDirect_for_PLCs_(OPC_-a-_DDE).
« Last Edit: November 04, 2010, 04:40:12 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.

Bill Cuchinski

  • Newbie
  • *
  • Posts: 6
Re: PLC to PC Communications
« Reply #6 on: November 04, 2010, 04:58:30 PM »
Correct on the scanner information it is used for other uses also. Secondarily(?) it will send a value to
the PLC on what part is being run. I need help with the programming of the PLC on the communication with the PC
and how to get the part running value the PC has, into the PLC. The IT group of the customer is handling the PC
program and how to convert the actual Part number into a value of 1 to 14 that is already  defined in the PLC for use in manual mode. I will take their value and activate the logic for that part number based on their value, but
I don't know how to get their value into the PLC V400 file.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: PLC to PC Communications
« Reply #7 on: November 04, 2010, 05:09:02 PM »
As far as the communication of the part number to the PLC, the PLC will essentially play a passive role. It the customer aleady has a program which is receiving and converting the value then the addition of the communication package to their PC may provide the pathway that program needs to send the value to the PLC. The communication package provides an OPC or DDE (slightly older Windows technology) pathway which any Windows program whould be able to use as a communications path. Check that out with the customer's programming people giving them the link to the package.

Inside the PLC the use of simple number comparisons can be used to trigger the appropriate actions. If the values will come in at odd intervals (without regard to other items that the PLC may be controlling) then I would set the program to trigger the action then set V400 to zero. The location would be monitored for a change to a non-zero value which would be the trigger that a new reading had arrived.
An output is a PLC's way of getting its inputs to change.

Bill Cuchinski

  • Newbie
  • *
  • Posts: 6
Re: PLC to PC Communications
« Reply #8 on: November 05, 2010, 03:21:33 PM »
So all I have to do is monitor V400 for a value greater than 0. Move that value to maybe V401 in order to act on it in my logic, zero out v400 and monitor it for a value change again? Do I need a command to change value from Hex to
Decimal?

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: PLC to PC Communications
« Reply #9 on: November 05, 2010, 03:52:21 PM »
'Hex' or 'Decimal' is how you, the human, looks at it. To the PLC, as long as it is not expecting BCD, the manner the number appears to you is irrelevant.

Be aware that the 'standard' math instructions are, because of the historical background of this line, expecting BCD numbers. The 'binary' operations (basically the same math instructions with 'B' on the end, expect the normal type numbers.

If this is confusing try my observations http://www.theplcguy.com/ABtoAD/NumberTypes.htm at my web site. Check the 'another treatment' PDF toward the bottom of that page.
An output is a PLC's way of getting its inputs to change.

Bill Cuchinski

  • Newbie
  • *
  • Posts: 6
Re: PLC to PC Communications
« Reply #10 on: November 05, 2010, 04:42:45 PM »
thanks for all your help.