Excel 4 macros

tomneth

Member
Join Date
May 2002
Posts
110
I have a bunch of Excel 4 Macros that I converted to Excel 2000. These macros request PLC data through Wonderware's Modbus Plus I/O server, version 7,1,0,0. These macros worked well with an earlier Wonderware version and Modbus Plus I/O server version 4. Now I know I should be converting these to VBA and will eventually. Wonderware (InTouch ver 7.1) works fine with the I/O server and I can get data directly to a spreadsheet using the formula: =MBPLUS|'PLC1'!40100. However I'm looking at a lot of registers over many PLC's and hope I can make the existing macros work for now. The existing macros are as follows:

=ERROR(FALSE)
=APP.MOVE(0,768)
Channel=INTIATE("MBPLUS","PLC1")
L6TStamp=REQUEST(Channel,"40100")
L6Stops=REQUEST(Channel,"40101")
L6Prod=REQUEST(Channel,"40102")
etc...
etc...
=TERMINATE(Channel)
=RETURN()

Then there is another macro,that opens a spreadsheet and pastes the data and inserts a new row. That one works fine but I'm not getting any new data. When I step into the macro it gets stuck at the first REQUEST line. Since everything else works I'm assuming there is a problem with the syntax but I'm not really sure because when I set the MBPLUS server to NetDDE it doestn't get stuck at rhe REQUEST lines but I'm still not getting any data. Anybody have any ideas on this?
 
In Excel 2000 or VBA try this syntax instead:

Let me know if that worked.



=ERROR(FALSE)
=APP.MOVE(0,768)

Channel=DDEInitiate("MBPLUS","PLC1")
L6TStamp=DDERequest(Channel,"40100")
L6Stops=DDERequest(Channel,"40101")
L6Prod=DDERequest(Channel,"40102")

etc...
etc...

DDETerminate(Channel)

=RETURN()
 

Similar Topics

Hi, I'm trying to export data from a DataGrid to Excel using VBA, but I'm getting an error "Object doesn't support this property or method". The...
Replies
0
Views
99
I don't know if this is the right place for the subject at least I'll try. The company has one of the oldest computers that is a master Windows...
Replies
5
Views
772
Hi, I'm just looking for a simple way to make a button in excel (via VBA I presume) to toggle a bit in RSLogix 5000. I just got FactoyTalkLinx...
Replies
9
Views
583
Hello, I want to send the data from Rslogix500 to Excel. I created a connection between RSlinx and Excel. The values in Excel automatically...
Replies
5
Views
1,212
Hi guys, Im back again, this time I cannot minimized excel even though i put 6 on the exec mode.. this is my cicode.. Exec("C:\Program...
Replies
1
Views
1,099
Back
Top Bottom