Test and Measurement Forum

Multiple Channels via DDE from a TC-08

Forum for discussing PicoLog

Multiple Channels via DDE from a TC-08

Postby mhayes » Wed Apr 14, 2004 2:28 pm

I am using the following code to successfully read the current value from Channel 1 of a TC-08 via DDE into Visual Basic in Excel
a = Application.DDEInitiate("PLW", "Current")
b = Application.DDERequest(a, "Value")
What is the syntax for the second and subsequent channels to be read?
mhayes
 

Postby markspencer » Thu Apr 15, 2004 8:16 am

Hi,

Unfortunately, DDE is not correctly set up to work with more than one channel. I can provide a macro in excel that will overcome this problem for you, please send an email to:

tech@picotech.com

and I will forward the example to you. Please quote this post.

Best regards,
Regards,

Mark Spencer
User avatar
markspencer
Site Admin
Site Admin
 
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Re: Multiple Channels via DDE from a TC-08

Postby Marjunvai » Fri Aug 15, 2014 3:55 am

Sir,

i am having the same problem, I have trying to display the data to MS Excel instantaneously but all I can do is display the values for Channel 1.

Here is my syntax =PLW|Current!Value

How can I go around this and display the values for the other Channels?
Marjunvai
Newbie
 
Posts: 0
Joined: Fri Aug 15, 2014 3:44 am

Re: Multiple Channels via DDE from a TC-08

Postby Hitesh » Fri Aug 15, 2014 9:28 am

Hi Marjunvai,

I have responded via your e-mail support request.

For the benefit of other users, there is a sub-routine defined in an MS Excel macro that was sent to Marjunvai:

Code: Select all
Sub GetCurrentData()
   
    chan = DDEInitiate("PLW", "Current")
    If TypeName(chan) = "Error" Then
        Repeat = False
        MsgBox "PicoLog cannot be found - Macro Halted!!"
    Else
        returndata = DDERequest(chan, "Name")
        For i = LBound(returndata) To UBound(returndata)
            Worksheets("Sheet1").Cells(i + 3, 1).Value = returndata(LBound(returndata) + i - 1, 1)
        Next i
        returndata = DDERequest(chan, "Value")
        For i = LBound(returndata) To UBound(returndata)
            Worksheets("Sheet1").Cells(i + 3, 2).Value = returndata(LBound(returndata) + i - 1, 1)
        Next i
        returndata = DDERequest(chan, "Units")
        For i = LBound(returndata) To UBound(returndata)
            Worksheets("Sheet1").Cells(i + 3, 3).Value = returndata(LBound(returndata) + i - 1, 1)
        Next i
        DDETerminate chan
    End If
    If Repeat Then Application.OnTime Now + TimeValue("00:00:01"), "GetCurrentData"
End Sub


Hope this helps.
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2009
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to PicoLog

Who is online

Users browsing this forum: No registered users and 0 guests