Jump to content

mcduff

Members
  • Posts

    55
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by mcduff

  1. Quote

    FYI, if you zoom in the Excel export will only show that data, and it's very strange that it using 1k and 10k instead of 1000 or 10000

    This is why "Export to Excel" is a useless feature. The data is exported using the display format of the plot's axes; since the plot uses SI formatting, it is expressed as 10k, 100k, etc. This does not help if someone wants to plot the data in Excel.

  2. Before you convert to a string why not take the String from the Read Function, convert to Byte Array, split it into the fixed lengths you want then convert into string. This can be done in a for loop, have an array of lengths and use that to split the string.

  3. To make things really efficient, echoing what was said earlier:

    1. Read about 100 ms of data (1/10 of the sample rate). Except set the number of samples to the closest even multiple of the disk sector size. Typically the sector size is 512 B, so for that case set the number of samples to 10240.
    2. Set the buffer size to an even multiple of (1) that is at least 4 - 8 s worth of data.
    3. Use the built in logging function in DAQmx to save the data; don't roll your own with a queue as in your example.
    4. Get rid of the unbounded array in your example; it keeps growing.

    I have not taken data for years non-stop, but using 1 & 2 above, taken 2 weeks continuously 8 channels at 2MSa/s each, using a laptop and USB-6366.

  4. 2 hours ago, ShaunR said:

    Interesting. I assumed you used the TEK one here.

    It looks very much like the whole API is a "work in progress" as many functions are not supported and...

    Do they distribute the DLL source code as part of an SDK?

    Their "LabVIEW distribution" is nothing more than using the DLL import function for the RSA.DLL.

    I have not looked at the other sources on the GitHub page; not sure if the source code for the DLL is included on that site or not. I have only downloaded the DLLs.

  5. TEK did not make a LabVIEW API. I used the DLL import wizard along with the RSA DLL. Not sure what API Matlab is using but below is a screenshot from the programming manual; no device ID for a disconnect. :( These are the functions exposed in their DLL.

    This Spectrum Analyzer has its own DLL and it can continuously stream data up to 56MB/s; as ShaunR said, this type of streaming is not well suited for a COM port.

    This device is not using SCPI  commands with their provided DLL. However, it can use SCPI commands if you install their software (Signal Vu) and make a virtual VISA Port. But if you do that, then no high speed streaming which is needed for this application.

    Snap4.png.4bd04604055787dd1d4854f56aa13c37.png

  6. Yes, it has both of those functions and a device disconnect also. 

    The Device Connect specifies a particular instrument. All other calls have no specifiers, even Device Disconnect. The API kind of stinks. My guess is, you specify an instrument in the beginning and that is it; everything else defaults to that instrument.

    EDIT: These functions are using the RSA.DLL

    mcduff_0-1670609104251.png.085d969b291f13fe1e596affe7b8db06.png

  7. This is a somewhat out of the box idea and want to bounce it off people to see if there are any issues. (It would take some time to test, so I want to check if anyone has done anything similar.)

    I am trying to write a program that controls a TEK RSA507A. It has a DLL API that can interface with LabVIEW.

    The main problem is that the DLL does not support multiple instruments running at the same time; that it, there is no handle/address analogous to a VISA Address. 

    On this site it says "In order to communicate with multiple RSA’s simultaneously you will need to call multiple instances of the RSA API. The API will need to be called for each RSA. "

    I assume that means if I have name the DLL differently for each instance, then I can call multiple instruments.

    Idea:

    1. When EXE opens, detect the number of instruments, then copy and rename the RSA.DLL in a temporary folder, e.g., RSA_1.dll, etc.
    2. Use the temporary DLLs to call functions for each instrument.

    Possible Problems:

    1. These DLLs call other DLLs, do not know if there will be any data corruption when that happens. I cannot rename the other DLLs.
    2. Will Windows let me copy and use a new DLL? Is that some kind of security problem?

    Am I missing anything else?

    Cross posted here

  8. On 10/18/2022 at 4:10 PM, MikaelH said:

    FYI, I've found the WebVIEW2 WebBrowser integration into LabVIEW + a fancy DataGrid JavaScript library is a much flexible approach.
    We've posted the LV-64 bit supported WebView2 support here: https://github.com/ANSCenter/LcWebView2
    I use http://tabulator.info/  to make nice DataGrids in LabVIEW.

     

    Do you have any advice for installing WebVIEW2? I have gotten it to work on one computer but not another for the same exact installation, I think. Thanks

  9. Sorry for haste when making the diagram, I made some typos.

    So please excuse my stupidity and ignorance, but here it goes.

    The IQSTRMIQINFO Structure contains the following content

    IQSTRMIQINFO(Structure):
    [('timestamp', c_uint64),
    ('triggerCount', c_int),
    ('triggerIndices', POINTER(c_int)),
    ('scaleFactor', c_double),
    ('acqStatus', c_uint32)]

    So I should set up my cluster as shown below and use DSNewPtr and MoveBlock if I want to read the data.

    image.png.4d894ee5262e653e167ebef9220968d9.png

     

    If I have the function in a tight loop, can I make the pointer outside the loop and use it over and over again until I exit the loop and dispose of it?

    Thanks

     

  10. @OP Sorry, don't mean to hijack this thread but...

    @dadreamer A few more quick questions.

    I am trying to interface with a TEK RSA using their RSA API. There is a function that allows one to stream the data from the instrument to the client, called IQSTREAM_GetIQData.

    The function prototype looks like this

    ReturnStatus IQSTREAM_GetIQData(void* iqdata, int* iqlen, IQSTRMIQINFO*
    iqinfo)

    Iqdata is an array of data and I think I can use the Array Data Pointer function in the library function, iqlen is just the length of the array. I believe the problem I am having is the IQSTRMIQINFO structure. The structure looks like this

    IQSTRMIQINFO(Structure):
    [('timestamp', c_uint64),
    ('triggerCount', c_int),
    ('triggerIndices', POINTER(c_int)),
    ('scaleFactor', c_double),
    ('acqStatus', c_uint32)]

    There is a pointer to an array of 100 elements in the structure. If I am understanding you correctly, I should use the pointer from DSNewPtr in the cluster, instead of an array. (See example below.) In the Call Library function what should the data format be: Handles by Value, Pointers to Handles, Array Data Pointer, or Interface to data?

    Thanks again for all of your help.

    image.png.e6599b8cebe5d54abd16d6ddf3081716.png

  11. Hallo
    Përshëndetje (Per-shen-DEAT-ye)
    مرحبا (marhabaan)
    Salam
    Kaixo 
    Demat 
    Здравейте (Zdraveĭte)
    Hola
    Moni
    Bonghjornu
    Bok
    Ahoj
    Hej
    Hallo 
    Hello
    Saluton
    Tere
    Kamusta
    Hei
    Bonjour
    მიესალმები (miesalmebi)
    Hallo
    Χαίρε (chai-ray)
    Hello
    שלום (shalom)
    नमस्ते (namaste)
    Helló
    Dia dhuit
    안녕하세요 
    Ciao
    ສະບາຍດີ (sabaidi)
    Salve 
    Sveiki
    Bongu
    नमस्ते (namaste)
    سلام (salam)
    Olá
    Buna
    Talofa
    Mhoro
    Ahoj
    Zdravo
    Hola
    Hodi
    வணக்கம் (vanakaam)
    Merhaba
    chào bạn
    Helo
    העלא (hela)
    Sawubona

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.