×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Excel to SLC500 how to write values?

Excel to SLC500 how to write values?

Excel to SLC500 how to write values?

(OP)
What is the syntax to write a value back to the plc?

I am currently able to read values from the plc in my Excel sheet using a driver from wonderware (ABKF2) for serial communication. My Topic is ABPLC. Here is the string in my A1 box.

=ABKF2|ABPLC!O1.5        
This allows me to view the status of O:1.5

EX: If i want to write a value of 1 to my plc adress O:1.0
What do i have to do?

Thanks

RE: Excel to SLC500 how to write values?

Are you comfortable with Excel macros and VBA?
This is the only way to write to PLC.
I can provide you a sample macro, but you have to know how to create it for editing and how to call it from application.

RE: Excel to SLC500 how to write values?

(OP)
Yes can you give me the macro all i need is the proper syntax

RE: Excel to SLC500 how to write values?

I succesfully use the following in my projects for Mitsubishi.
It should work with any other brand DDE driver.

Sub WRITE_TO_PLC (PLC_DEVICE As String, DATA As Long)
CHANNELNUMBER = Application.DDEInitiate(app:="ABKF2", topic:="ABPLC")
Range("DATA_FOR_PLC").Value = DATA
Application.DDEPoke CHANNELNUMBER, PLC_DEVICE, "DATA_FOR_PLC"
Application.DDETerminate CHANNELNUMBER
EndSub

There must be a cell named DATA_FOR PLC elsewhere in the Excel workbook.
Errors processing is not shown here.

RE: Excel to SLC500 how to write values?

(OP)
Where is the PLC adress in this example ?
And how can i start a macro from a cell value?

RE: Excel to SLC500 how to write values?

RayfromIntech,
The subroutine should be called with two parameters.
The first parameter is the string value indicating the PLC device.
The second parameter is the data to be written.
Use 1/0 to set/reset a bit device.
Example:
Call WRITE_TO_PLC ("O:1/5",1)

I do not understand your second question.
Are you asking how to link this subroutine to the specific cell, or how to start the macro?

RE: Excel to SLC500 how to write values?

I'v always been told that you can't write directly to an output on slicks. Have you tried to mov the value of this output to an integer or binary, and tried to read or write to that address.

RE: Excel to SLC500 how to write values?

spuds,
You're probably right, I really don't know.
As I mentioned, I use the macro for Mitsubishi and there it's possible to write to any device, including input(!)- it will be forced for one scan.

RE: Excel to SLC500 how to write values?

(OP)
Thanks pepeol this is good stuff will try this!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources