ntommyb
Member
I've seen a bunch of these while searching but none address what I'm trying to do. I'm just trying to learn how this works, I've done some transfering of data to spreadsheets for displaying and a few buttons through VBA that write to the data table but thats really about it.
Heres an example
Private Sub CommandButton1_Click()
RSIchan = DDEInitiate("RSLinx", Range("Sheet1!F4"))
DDEPoke RSIchan, Range("Sheet1!F15"), Range("Sheet1!A2")
DDETerminate (RSIchan)
End Sub
Sheet1!F4 is my OPC topic in the Spreadsheet cell
Sheet1!F15 is a listbox that allows me to select the bit to toggle.
Sheet1!A2 is a 1 in a cell to push the value to the data table
Problem
I'd like to use something else that pushs a 1 while the button is depressed and pushs a 0 when it releases
Problem 2
I'd also like to display the result in a textbox but it keeps displaying whatever I type in instead of treating it like a link, for example
Private Sub TextBox2_Change()
TextBox2.Text = ("=RSLINX|DMONTOPIC!'_000PLC01.iDiagnostic2,L1,C1'")
End Sub
just displays
("=RSLINX|DMONTOPIC!'_000PLC01.iDiagnostic2,L1,C1'")
If anyone has an answer, it would at least give me somewhere to start. Also I'm interested in learning this so if you could explain it a bit instead of just solving my problem that'd be great.
We have standard logic at the plant I'm working at and I'm trying to set up a manual function utility that's flexable and lean enough to just take to any line and just set the OPC topic in the excel spread sheet instead of using the underdeveloped clunky RSView interface they use here
Heres an example
Private Sub CommandButton1_Click()
RSIchan = DDEInitiate("RSLinx", Range("Sheet1!F4"))
DDEPoke RSIchan, Range("Sheet1!F15"), Range("Sheet1!A2")
DDETerminate (RSIchan)
End Sub
Sheet1!F4 is my OPC topic in the Spreadsheet cell
Sheet1!F15 is a listbox that allows me to select the bit to toggle.
Sheet1!A2 is a 1 in a cell to push the value to the data table
Problem
I'd like to use something else that pushs a 1 while the button is depressed and pushs a 0 when it releases
Problem 2
I'd also like to display the result in a textbox but it keeps displaying whatever I type in instead of treating it like a link, for example
Private Sub TextBox2_Change()
TextBox2.Text = ("=RSLINX|DMONTOPIC!'_000PLC01.iDiagnostic2,L1,C1'")
End Sub
just displays
("=RSLINX|DMONTOPIC!'_000PLC01.iDiagnostic2,L1,C1'")
If anyone has an answer, it would at least give me somewhere to start. Also I'm interested in learning this so if you could explain it a bit instead of just solving my problem that'd be great.
We have standard logic at the plant I'm working at and I'm trying to set up a manual function utility that's flexable and lean enough to just take to any line and just set the OPC topic in the excel spread sheet instead of using the underdeveloped clunky RSView interface they use here