Hello Guest it is April 29, 2024, 09:23:27 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Roboticist

Pages: 1
1
VB and the development of wizards / Re: RSLinx DDE/OPC
« on: January 28, 2015, 12:40:49 PM »
RS Linx is used to transfer the registers of the PLC to Microsoft Excel where it can be read by Cypress Enable native to Mach3.  There are 3rd party drivers and code, but I found they didn't work at all with Mach3.

2
VB and the development of wizards / Re: RSLinx DDE/OPC
« on: June 12, 2014, 12:56:53 PM »
I hope nobody minds me filling space here.  You never know when someone else my want to try this.

The problem is now resolved.  I had to got to Excel 2003 and update Mach3 to the latest version.  Even though my version number matches it didn't work till I updated it. ???

Also Excel needs to be open in the background with my file in it to work right.  Could have something to do with the math I'm doing in Excel.

So all is well now.

Thanks!

3
VB and the development of wizards / Re: RSLinx DDE/OPC
« on: June 11, 2014, 01:21:08 PM »
Ok, new problem, same programming issue.  Here's what's going on: 

I am currently attempting to use GetObject to read cells from an Excel file.  The Excel file is loaded with values linked to RS Linx and works very well.  The problem is that even though the code works in the editor as expected, it will not work when called from a line of code as a macro.  The error message "coinitialize has not been called" comes up and the macro will not run.

I have the latest version of Mach3 running and licensed.  I read in the forums where the problem was fixed for CreateObject but could not find anything for GetObject.

Please let me know if I'm doing something wrong or if you can help me.

Thanks.

Code follows:

Dim MyData As Object
Dim data As Integer
Dim gobit As Integer
Dim xlworksheet As Object
Dim filename As String
Dim temp As String
Dim count As Integer

Set MyData = GetObject("c:\mach3\n751.xls")

Set xlworksheet = mydata.Worksheets("sheet1")



While gobit = 0
   Set gobit = (xlWorkSheet.Cells(1, 2).value)
   message gobit
Wend

Set data = (xlWorkSheet.Cells(1, 1).value)
'message data

Set filename = ("C:\mach3\GCode\" & data & ".txt")

'message filename

temp = Dir(filename)


If temp = "" Then
   message "not loading file"

Else

   message "loading file"
   LoadRun(filename)
   
   
End If

4
VB and the development of wizards / Re: RSLinx DDE/OPC
« on: May 28, 2014, 10:25:08 AM »
Well, after 3 weeks of messing with it  ??? and reading every post I could find from Rockwell to Mach and Cypress Enable, here's the code that finally works  ;D :

Dim MyData As Object
Dim data As Integer
Dim xlworksheet As Object
Set MyData = GetObject("c:\mach3\n751.xls")
Set xlworksheet = mydata.Worksheets("sheet1")
Set data = (xlWorkSheet.Cells(1, 1).value)
message data

The file n751.xls has the ole object in cell A,1 from RSlinx.  Excel does not need to be open on the computer, but it does have to be loaded and available.

The number in Data can now be used to open a specific file number in the mach3\files directory.  I'm still working the bugs out of that one, but will post my results here if anyone is interested.

Cam McCrackin
Roboticist

5
VB and the development of wizards / RSLinx DDE/OPC
« on: May 26, 2014, 03:17:48 PM »
Hello all!

I have been trying for over a week now to figure out how to make Mach3 talk to an Allen Bradley SL5/05 processor through Ethernet.  What I have come to is loading RSLinx on the Mach3 computer and sharing a DDE object from there.  What I really need now is sample code to read the DDE object from RSLinx.

The end game is to set a number in the N7 register to tell Mach3 which program to load and run from the PLC.

Thanks for any help anyone can give!

Cam McCrackin
Roboticist

Pages: 1