Shop OBEX P1 Docs P2 Docs Learn Events
DDE connexion — Parallax Forums

DDE connexion

luisferluisfer Posts: 12
edited 2011-12-13 07:50 in Accessories
Hi, I am having problem to establish a DDE connexion between PropScope and LabView. I do not know how to do it because I need to know the name of the server and the topic in order to setup the dde connexion. Hanno told me that PropScope has a dde server built in; but when I write PropScope as the name of the service the connexion is not established. I was able to establish a connexion between ViewPort and LabView, but I am not registered and I have no more budget in my project. In the review: ViewPort Client kit, it is very well explicated but it is not for PropScope, just for ViewPort.
In brief, I need to know the topic an the service of PropScope to establish a DDE connexion

Please I need an answer quickly because I am approching to the dateline.

Luis

Comments

  • HannoHanno Posts: 1,130
    edited 2011-07-01 18:35
    Hi Luisfer,
    I know all about tight deadlines :) Good luck! Please tell me as much about what you need so I can help you succeed.
    The DDE server in PropScope is the same one that's in 12Blocks and ViewPort- to allow clients to interoperate with all 3, even the server is identical. So, just download the client kit and/or look at previous threads such as these:

    http://forums.parallax.com/showthread.php?114112-Viewport-DDE-or-DLL-data-or-.NET-object
    http://hannoware.com/viewport/clients.php

    Hanno
  • luisferluisfer Posts: 12
    edited 2011-07-02 04:38
    Thanks for your encouragement Hanno!
    Sorry for my english :innocent: I know that I should improve it! I hope that it will not be an inconvinient to explain clearly my problem. I have read your recomendated threats but I did not solve my dubt.

    I need to transfer two variable's value from PropScope to LabView: time and voltage.

    In order to do that, I need to establish a DDE connexion between the PropScope and LabView. To do that I need to know the name of the server, and the topic of the PropScope's DDE built in .

    Using as a exemple the ViewPort's DDE, the server's name is ' vp ' and the topic's name is 'system'.
    The question seems easy to be answered, When I want to establish a connexion, What must I write as server and as topic?

    Luisfer
  • HannoHanno Posts: 1,130
    edited 2011-07-03 16:15
    Hi Luisfer,
    Sorry I wasn't clearer in my previous reply. The DDE server is exactly the same, so you can use the same commands as for ViewPort.
    Since you wanted to retrieve the time as well, I bundled together some changes in a new package- please download and install this beta:
    http://hannoware.com/propscope/propscope203.exe

    The easiest way to see how this works is with Microsoft Excel or OpenOffice Calc:
    - Start PropScope
    - Start Excel/Calc
    - Type this formula into a cell: 'vp|system!list' for Excel, 'DDE("vp";"system";"list")' for Calc
    - PropScope should reply with the list of channels to track, including CH1, CH2 and DAC- you can also track $time
    - To get the voltage for CH1 type this formula: 'vp|get!CH1' for Excel, 'DDE("vp";"get";"CH1") for Calc
    - In Excel and Calc, the cells value will now continually update with the measured voltage. See the client kit for details on how to retrieve multiple values in different formats programatically.
  • luisferluisfer Posts: 12
    edited 2011-07-04 07:14
    Hi Hanno, the previous two threads were really clear and helpful.

    When I used LabView, I was able to obtain the variable's list, included CH1; but when I want to see (or request) the value LabView shows as a value "Couldn't find result item:CH1". Now I think that may be LabView does not work properly with Windows Vista.
    When I tried to do your example for Excell (Excell 2007) it does not response. May be windows vista is not my adequate operative system. I will try to do this two steps with Windows XP, hopefully this was my mistake.

    Sinceraly grateful for your help and your time dedicated.

    Luisfer
  • HannoHanno Posts: 1,130
    edited 2011-07-04 21:29
    Hi Luisfer,
    Sorry that you're still having problems. Ideally give me as much info as you can- tell me exactly what you're doing, and ideally take screenshots. "Does not response" doesn't tell me much.
    Please do this:
    - Install PropScope v2.03 using above link
    - Just to be thorough- restart your PC
    - Make sure PropScope is connected, start v2.03, and in Excel type: 'vp|system!list' into one cell and 'vp|get!CH1'
    - In LabView request system:list and get:CH1
    Make sure CH1 is capitalized....
    Hanno
  • luisferluisfer Posts: 12
    edited 2011-07-08 09:43
    Hi Hanno,

    New software works!
    Just installing the new software I was able to take one value acquisition of CH1 (I do not know why with the previous PropScope v2.02 software dde does not work properly!) Thank you for offer me the new one!
    I need to ask you about, how dde transfers data?
    I mean, when you are saving data directly from propscope with a time scale fast enough, PropScope takes 1024 consecutives samples and send them "together in a pack" ('stream mode'). I was able to obtain just one value using the dde with LabView.
    Then my question is, if I use a 'for' loop with 1024 iterations, will dde transfer me 1024 consecutives values as it was a "pack"? I need to analize a signal that comes from a spectrometer,
    I know that I am not able to acquire data continuously, then for my project it is enough to acquire data as the propscope do with "stream" mode, which is obtaining 1024 consecutives points, and 1 second after, another pack of others 1024 (does not affect that both packets are not consecutives).

    Thank you,

    Luisfer
  • HannoHanno Posts: 1,130
    edited 2011-07-12 03:21
    Hi Luisfer,
    Great that you're able to read values from the PropScope to LabView via DDE. DDE is not fast enough to let you query multiple samples if the PropScope is sampling at full speed- you'll need to grab an entire array's worth. The built-in DDE server allows that- but currently only for the "io" channel- which doesn't have calibration or scaling applied. You can give it a try by typing in "vp|system|detail(io)", you'll see that there are ~1080 items- they represent the consecutive measurements. Tomorrow I'll try to make CH1 and CH2 accessible in a similar fashion.
    Hanno
  • vettezr1vettezr1 Posts: 77
    edited 2011-07-13 07:11
    Hanno this would also aid me greatly but I am using microsoft office 2007 and I can not figure out how to make this work I used the new version 3 typed the samples you gave started propscope but for the life of me can not figure out how to connect with excel I finally found a calc function in excel but it did nothing is there somehting I have to do witht the prop scope I want to be able to record values into excel thanks
  • HannoHanno Posts: 1,130
    edited 2011-07-13 20:15
    calc.png
    csharp.png
    vb.png
    Hi!
    Alright- let's have some fun :)
    As you know, PropScope takes >1000 measurements for CH1, CH2 and DAC every sample. These are adjusted for calibration and scaled then stored in an array for graphing.
    You can now use DDE from pretty much any application (the client kit available here: http://hannoware.com/viewport/clients.php shows sample programs in VB, C#, matlab, Excel, Calc, python) to retrieve these arrays in a variety of ways:
    - you can grab the entire array of values in one go. Each value is stored as a 4 byte integer representing millivolts. Do this by using DDE to request CH1/CH2/DAC with format 12.
    - you can grab a string of all values in one go. Use format 11 if you want units or format 1 if you just want the values.
    - you can grab a single element in format 12, 11, or 1- request the item and index- like this: CH1(0)

    Latest PropScope is v2.04-http://hannoware.com/propscope/propscope204.exe
    Please read up on DDE if you're confused about formats, retrieving...
    Here some screenshots of PropScope with OO Calc, VB.NET and C# clients...
    Hanno
    855 x 530 - 105K
    308 x 304 - 20K
    613 x 437 - 37K
  • luisferluisfer Posts: 12
    edited 2011-12-13 07:50
    Hi Hanno!

    I have been some time disconnected and I haven't been able to solve my problem. You could see three comments above, in the last comment you wrote to me, you answered me ' I'll try to make CH1 and CH2 accessible in a similar fashion.'
    It means that I could be able to obtain the 1024 data from one channel in one pack calibrated and scaled, doesn't it?
    I was looking for this software and I did not find it. Did you already change this part of the software?

    The second question I have is about the number of data acquired using the topic called 'io' because when I request detail(io) appears as a comment: 'Array type 2 at global address:$263C, length:1081 longs'
    I understand that takes 1081 samples not 1024 samples. I have this question because I also need the parameter time to represent the data.

    Thanks in advance

    Luisfer
Sign In or Register to comment.