Access the DataSocket only using nids.dll

Hello
I have the task to communicate to a program, written in LabView, while communicating data hit, using only the INIDSCtl and ICWData of nids.dll interfaces. Communication in the sense that I send data to the program LabView works, but I have problems receiving data. The data that are sent are a set of 4 floating values (32 bit floatingpoint). I can see in the diagnoses of Server Socket given that there really are packets sent, but I can't receive these data.
I'm this programming in C++ using MS Visual Studio 6.0. I don't have any other tools (such as Measurement Studio).

The labour code to send only an integer value is simple 16 bit (I removed all control error for shorter code)

#import "C:\windows\system32\nids.dll" raw_interfaces_only, no_namespace, named_guids
...
HRESULT hr = g_pNIDSCtl.CreateInstance("CWDSLib.CWDataSocket");
...
ComBSTR bstrURL (_T ("dstp://localhost/emmenu_to_ts"));

HR = g_pNIDSCtl-> put_URL (bstrURL (bstr_t));
HR = g_pNIDSCtl-> put_AccessMode (cwdsWrite);

b short;
HR = g_pNIDSCtl-> SyncConnect (30000, & b);

ICWData * pData = NULL;
HR = g_pNIDSCtl-> get_Data (& pData);

CComVariant varStart (short) 1;
HR = pData-> put_Value (varStart);
pData = NULL;

HR = g_pNIDSCtl-> Update();

HR = g_pNIDSCtl-> Disconnect();

However, the code to retrieve the data that does not work is as follows

CComBSTR BstrURL (_T ("dstp://localhost/ts_to_emmenu"));

HR = g_pNIDSCtl-> put_URL (bstrURL (bstr_t));
HR = g_pNIDSCtl-> put_AccessMode (cwdsRead);

b short;
HR = g_pNIDSCtl-> SyncConnect (30000, & b);

ICWData * pData = NULL;
HR = g_pNIDSCtl-> get_Data (& pData);

CComVariant varVal;
HR = g_pNIDSCtl-> Update();

HR = pData-> get_Value (& varVal);
//
VarVal HERE is always 0, regardless of the values in the data?
//
pData = NULL;

HR = g_pNIDSCtl-> Disconnect();

My question: is it still possible to recover a table of 4 floats using only nids.dll interfaces and if yes, can someone push me in the right direction or give me some advice.

Thanks in advance
Peter

Hello Peter,.

Sorry I mixed things up... I really need a window because I wanted to be able to use INIDSCtl.SelectURL ().

But there is no need to use DataSocket. The important things are:

1. call CoInitializeEx() with COINIT_MULTITHREADED parameter.

2. when 2 une fois connecte connected to the server, call INIDSCtl.GetStatus () repeatedly until it returns cwdsConnectionActive.

3. call INIDSCtl.Update () and read your data.

Here is a quick and dirty example you can try in conjunction with "DS Writer.vi' example:

#define _WIN32_WINNT 0 x 0501

#include
#include
#include

#include

#import 'nids.dll"no_namespace don't

int main()
{
HRESULT hr = CoInitializeEx (NULL, COINIT_MULTITHREADED);
{
Instantiate DataSocket.
DS INIDSCtlPtr;
HR = ds. CreateInstance (__uuidof (CWDataSocket));

To connect to the server.
HR = ds-> ConnectTo (_bstr_t (L "dstp://localhost/wave"), cwdsRead);

Wait until the connection is established.
Status of CWDSStatus;
While ((statut = ds->GetStatus()) == cwdsConnecting)
{
Sleep (100);
}

Get data.
While ((hr = ds->Update()) == S_OK)
{
if(DS->GetDataUpdated() == valeur VARIANT_TRUE)
{
_variant_t retVal = ds->-> GetValue GetData();
check the type of the VARIANT. It must be an array of double.
If (V_VT(&retVal)! = (VT_ARRAY |)) VT_R8))
throw _com_error (E_FAIL);

Unpack the table.
SAFEARRAY * psa = V_ARRAY (& retVal);
If (psa is NOTHING)
Throw _com_error (E_POINTER);

He must have a dimension.
If (psa-> SICGD! = 1).
throw _com_error (E_FAIL);

Double HUGEP * vals;
HRESULT hr = S_OK;
If (FAILED (hr = SafeArrayAccessData (psa, (Sub HUGEP *) & vals)))
Throw _com_error (hr);

for (long unsigned I = 0; i < psa-=""> rgsabound [0] .cElements; i ++)
{
std::cout< vals[i]=""><>
}

Table is no longer needed.
If (FAILED (hr = SafeArrayUnaccessData (psa)))
Throw _com_error (hr);
}
}
}

CoUninitialize();

return 0;
}

Tags: NI Software

Similar Questions

  • I have the home Prenium and can't access the themes or use photos etc on desktop.

    I have Home Premium and can't access the themes or use photos etc on the desktop. All I have is a black screen. Also, I can't save screensavers, including by default. What is going on?

    Lisa

    Black screen after that Cruiser connection still works
    http://social.technet.Microsoft.com/forums/en-us/w7itproperf/thread/d47aece7-5e12-46EC-8d3e-e8671730a7ce

    If still no joy try this thread.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-desktop/Desktop-stuck-on-solid-colours-win-7-Pro/8e034d73-fbaf-45CD-a8eb-d8329e7f47e4

    If you have AVG see this.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-desktop/no-longer-see-thumbnails-for-applications-on-the/2b0a71ac-E75A-44a2-9198-2ac803644540

  • Why can't I access the internet without using safe mode

    Help cannot access internet without using safe mode

    Hi Dharrington25,
     
    -Remember to make changes to your computer after that this problem started to happen?
     
    As you are able to access the Internet using the safe, put your computer in a clean boot state in order to identify the program causing this problem.
     

    Put your boot system helps determine if third-party applications or startup items are causing the problem. If so, you need to maybe contact the manufacturer of the program for updates or uninstall and reinstall the program.

    See KB Microsoft article below for more information on how to solve a problem by performing a clean boot in Windows Vista or in Windows 7:How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the above article.

  • Can multiple users access the account and use services on different computers?

    ?

    Hi vighter,

    A subscription is related to an individual Adobe ID and password. The license agreement allows this user to access the subscription on up to two devices, but not at the same time.

    Best,

    Sara

  • Access the SMB storage using esxi host and manage with MS server 2008

    Hi there, I know the subject line can be confusing, but I didn't know how to explain what I need in the line object in such a short sentence.

    in any case, I have a storage device SMB, a Promise VTrak M610P, which is attached to a blade server 1U HP through interface channels double Ultra 320 SCSI host. I can't configure the VTrak as a NFS, the only way to access logical drives is connected to a server via the scsi channels and using the operating system to share the drive and the shared disks.

    I would use a server blade with dual ultra 320 SCSI host interface channels and connect the VTrak to this server blade. Then I would install ESXI hypervisor OS 5.5 to this server blade. I want to know is if the ESXI operating system will recognize the logical drives and if I create a virtual machine with MS server 2008 and see if the virtual machine detects logical drives, so that I can share the drives? I hope that I'm supposed to and if I'm not, please let me know what makes no sense, I will do the best to explain it better.

    Thank you

    Andy

    So it turns out that there seems to be something wrong with vClient when you add a hard disk (virtual disk) to a virtual machine of size greater than 4 TB. Article VMware KB: value of range error message when you add more than 4 TB capacity discs in vSphere Client describes this if you encounter this problem, add the hard drive via vSphere CLI, CLI power or vmkfstools. So this seems to be a known issue on vClient. What I ended up doing was using vClient, creation of hard disk, adding to the virtual machine (size of the hard drive is to 5.45) and when I would get the error message on the DiskCapControl out of reach, I would just click OK and then finalize the creation of the hard drive on the virtual machine. Once the process is complete, I selected the virtual machine and noticed that he indeed added a new HDD size 5.45 TB even if he's complained about it. I pulled to the top of the virtual machine with windows server 2008 R2 installed and was able to create a new disk under windows and set it up as a shared drive on the network. Looks like vClient must be updated by VMware and correct this bug, if it's a bug that I think. Thank you for the help vervoort!

  • To access the Oracle Postgres using DG4ODBC and very slow psqlodbc

    I've set up DG4ODBC a base of Oracle 11 g Windows 2003 32-bit to access a Windows 2008 64 bit 9.1 database Postgres, you use the psqlodbc (32-bit) driver.

    I can't do it because of the queries, but they are very slow. The reason is that the place where clause of the query is deleted somewhere along the line (I've seen actual queries run by Postgres using pgAdmin server status screen) and all the rows of the table are extracted from Postgres. Naturally with tables bigger than the few lines which means do a full table in Postgres scan, so that transfer a lot of bytes through the network.

    "For example, if I mark from Oracle like this: select * of" dps_user"@pg where 'id' = '2423', run the sql in Postgres is: select * from dps_user, which retrieves all the rows of the table! When I get the result of the query in Oracle, I get only the row with id 2423, so I guess that Oracle Gets the entire table and that he not filtering at its end.

    In a separate 32-bit Windows XP machine I have implemented the same psqlodbc driver, and ran the same query by using Microsoft Query. In this case, the query to run in Postgres contains a where clause and, therefore, it is much faster because a unique index scan is performed in Postgres, and that a line is transferred to Microsoft Query.

    Could you help me, please?

    Thank you very much

    Carlos

    Hi Carlos,
    Yes - he manipulated me the SR ;-)
    Sometimes they have a little more time and information to study can throw up the answer.

    Kind regards
    Mike

  • Extract the value of the node only using XQuery

    Hello

    I have a xml as XMLType stored in the table. XML is,

    < ocaStatus xmlns = "http://xmlbeans.apache.org/ocastatus" >
    < status >
    < > 990 statusCode < / statusCode >
    < statusDate > 2010 - 01 - 19 < / statusDate >
    < user name > OcaNimsAcf < / userId >
    < comment > DocumentnotinNIMS < / comment >
    < / status >
    < status >
    < > 990 statusCode < / statusCode >
    < statusDate > 2010 - 01 - 19 < / statusDate >
    < user name > OcaNimsAcf < / userId >
    < comment > DocumentnotinNIMS < / comment >
    < / status >
    < / ocaStatus >

    I use a combination of normal SQL and XQuery queries to extract data from table.
    I have a requirement where I have to shoot only value of XML node as only * 990 * without tags < statusCode >.
    I wonder if it's possible ass I've tried with two or three combinations of function extract().

    Thank you.

    Hello

    Different ways to do it, assuming you want the results in a relational table.

    XMLTable using:

    WITH t as (
     select xmltype('
    
    990
    2010-01-19
    OcaNimsAcf
    DocumentnotinNIMS
    
    
    990
    2010-01-19
    OcaNimsAcf
    DocumentnotinNIMS
    
    ') doc
     from dual
    )
    SELECT x.*
    FROM t, xmltable(
     xmlnamespaces(default 'http://xmlbeans.apache.org/ocastatus'),
     'ocaStatus/status'
     passing t.doc
     columns
      status_code number path 'statusCode'
    ) x;
    

    Using the 'old' (and obsolete) XMLSequence:

    WITH t as (
     SELECT xmltype('
    
    990
    2010-01-19
    OcaNimsAcf
    DocumentnotinNIMS
    
    
    990
    2010-01-19
    OcaNimsAcf
    DocumentnotinNIMS
    
    ') doc
     FROM dual
    )
    SELECT extractvalue( x.column_value,
                         'status/statusCode',
                         'xmlns="http://xmlbeans.apache.org/ocastatus"' ) as status_code
    FROM t, table(
     xmlsequence(
      extract(t.doc, 'ocaStatus/status', 'xmlns="http://xmlbeans.apache.org/ocastatus"')
     )
    ) x;
    

    Otherwise, targeting a specific node:

    WITH t as (
     select xmltype('
    
    990
    2010-01-19
    OcaNimsAcf
    DocumentnotinNIMS
    
    
    990
    2010-01-19
    OcaNimsAcf
    DocumentnotinNIMS
    
    ') doc
     from dual
    )
    SELECT extractvalue( t.doc,
                         'ocaStatus/status[1]/statusCode',
                         'xmlns="http://xmlbeans.apache.org/ocastatus"' ) as status_code_1
    FROM t;
    
  • How to access the 'Active Sessions' using MBeans

    Hi all

    I sent a request to the EM (Enterprise Manager).
    When I have connected on EM and click on the app, I see the number of active sessions under the heading "Servlets and JSP.

    How can I access this setting at the application level. ??
    (I want to access this setting * 'x' * my web application and display registered users: x )

    EM shows that the number of active sessions. It updates too... so there must be some beans or recording for this setting...
    How can I access who...?

    Kind regards
    Durieux.
  • To access the/sdcard-ext applications that allow only access /sdcard or/mnt/sdcard

    Hello...

    I use a few applications that are their resources in the SD card, but I like to store my files in the external SD card. I am a user coming from the Samsung Captivate, so he has never been a problem for me, because the Samsung phones access the external sdcard using a symbolic link from the inside of the internal sdcard, do something like

    / sdcard/external_sd

    But with the Atrix is completely different since the mount points are

    / mnt/sdcard and it is a symbolic link to /sdcard

    And the external SD card is

    / mnt/sdcard-ext with a symbolic link to/sdcard-ext

    Is there a workaround to achieve what I have to do? In my view, it is not possible to create a symbolic link because of the file system used in the SD card, but I could be wrong.

    Am I missing something here?

    Thank you very much


  • Cannot access the internet using the account invited in Vista. Unable to access using the administrator account.

    This one is strange - and I repeat that the problem is that I can't access the internet by using the administrator account.  The guest account works fine.  All programs are there and launch the fine (IE, Live Messenger, Yahoo Messenger, etc.), but they cling right there when I try to log on or access to any Web site.

    While in the administrator account, I ran "CMD" in the run menu and can ping Yahoo, Google, etc. with success.  It's embarrassing - any ideas how the administrator account can act that way then the guest account works perfectly?

    Hello Allen LaBrune,.

    If you are able to ping the websites from the command prompt, it means that your computer connectivity is fine.

    ·         What is the antivirus installed on your computer protection software?

    ·         Have you tried to browse by disabling the firewall?

    Try disabling the firewall on the computer and check if you are able to navigate.

    If this does not work, reset Internet Explorer settings and check if you can browse.

    To use the feature reset the settings of Internet Explorer in the Control Panel, follow these steps:

    1. exit all programs, including Internet Explorer (if it is running).

    2. If you are using Windows Vista, click Start, type the following command in the start search box and press ENTER:

    Inetcpl.cpl

    The Internet Options dialog box appears.

    3. click on the Advanced tab.

    4. Under Reset Internet Explorer settings, click Reset. Then click again on reset.

    5. when Internet Explorer has finished resetting the settings, click close in the reset Internet Explorer settings dialog.

    6. restart Internet Explorer.

    For you reference, you can visit the link for the following Article:
    http://support.Microsoft.com/kb/923737

    Thank you

    Irfan H, Engineer Support Microsoft Answers. Visit our Microsoft answers feedback Forum and let us know what you think.

  • To access the Tables using DB link.

    Hello friends,

    I have an env development and production.

    I created a public link to DB developing say mylink.

    Trying to access the development of production table using the following command say to access x table

    Table DEV to access the PROD x using dblink

    Select * from x@mylink;

    Got the error like:
    ORA-02019: description of the connection to the remote database not found
    02019 00000 - "description of the connection to the remote database not found"

    Any idea on why this error is coming...

    Thank you/kumar

    I have an env development and production.

    I created a public link to DB developing say mylink.

    Trying to access the development of production table using the following command say to access x table

    Table DEV to access the PROD x using dblink

    Select * from x@mylink;

    You try to run the query in the database of PROD. This query uses a DB link that points to the DEV database.
    Very simple to understand: as you use the LINK DB in the PROD database, obviously it should be in the area of PROD... right?
    Imagine you use a PROD ("DBLINK") object and it does not exist here. I have it?

    SELECT * FROM x@mylink;

    Here,
    x database DEV table
    myLink - DB LINK in the database of PROD (pointing to DEV)

    Please try this.
    HTH

    Published by: Vanessa B on December 25, 2012 12:24 AM

  • IMAP is not supposed to retrieve emails from the server only? In my case, all mails are downloaded to my mac and I can see the offline!

    IMAP is not supposed to retrieve emails from the server only? In my case, all mails are downloaded to my mac and I can see the offline!

    His grip on my mac space, even if I'm using the same settings for my Iphone email are not downloaded to the phone and its not not using any space!

    It is often possible to access the same account using IMAP or POP.

    Make sure that your settings are correct. The account type is on the first part of the account preferences.

  • Error when trying to access the microsoft update web site

    I am using windows XP Pro. SP3 32-bit (build 2600.xpsp_sp3_gdr.100216 - 1514)

    I have IE v8.0.6001.18702

    When I access the microsoft update web site, I get a message saying that I need to update windows update and I want that allows. No matter what I said or after 30 seconds have elapsed if I do nohting I get the message:

    • The instruction at "0 x 08100068" referenced memoery to '0 x 08100068', the memoery could not be "written".

    The address is different from one attempt to another, but both are still the same as eachother.

    When I close this tab IE grave message box down and I get the message 'recovered tab' normal.

    Can I search / install updates using vbscript widely available, or automatic update installation of windows. The problem only occurs when you try to access the web site itself.

    I tried to download and install the latest windows update manually, but this does not solve the problem.

    I am unaware of the date of the last update because I'm unable to access the update log.

    I use a current version of McAfee Anti-virus.

    I think my windows is a clean install, but I didn't do it, so I can't be 100% certain.

    Jacob

    I uninstalled ie8 and found ie7 under him.

    I am able to access the site WindowsUpdate using ie7.

    Jacob

  • custom palette with tabs to swf Flex cannot access the local file system

    OK, with Flash Player 10, we can load and save local files from a flex web application, then why can't I in the bridge, when I load the SWF in a palette with bridge tabs, load and save functions no longer work.

    Is it because I'm loading as a ScriptUI called range of flash, instead of a palette of HTML?

    I tried the overall Flash Player security in order to allow the authorization of my swf and created a .cfg, but nothing seems to work.

    Help, please.

    Thank you, Todd

    I don't know exactly how your Panel is a failure. I have attached three examples of Flex projects that include the JavaScripts and Flash panels for bridge. These all worked for me in Bridge CS4.

    To access the local, I used FileRefrence.save () for these tests - note that this method is file system was added in Flash Player 10, and so this will not work in Bridge CS3, which uses the Flash Player 9 when you use a widget Flash Player in ScriptUI. In addition, to compile the example I had to modify the Flex builder projects require Flash Player 10 by changing the settings on the page 'Flex compiler' project in Flex Builder settings.

    If you use another method to access the system files that works with Flash Player 9, please let me know what it is and I can test it.

    Among sovereign wealth funds also gain access to the network. To activate SWF access to the network, I had to add a file of global security settings. Information on creating these files are available here:

    http://www.Adobe.com/devnet/flashplayer/articles/flash_player_10_security.PDF

    But, for example, on my mac, I put all these projects in a "BridgeFlashPanels" folder on my desktop. Next, I created the BridgeFlashPanels.cfg file in/Library/Application Support / Macromedia / FlashPlayerTrust. The .cfg file had a line: the path to the folder on my desktop.

    A description of the panels:

    PanelWithNetworkAccess - this Panel has a 'Test' button, when clicked, loads http://www.adobe.com and place it in the text box (note, it will be just the raw HTML, does not make the page).

    PanelWithFileSystemAccess - for Flash Player 10 only, this Panel has a Test button and a text field. When you click the Test button, it writes the contents of the text box in the BridgeTest.txt file, unless you choose another file.

    PanelWithNetworkAndFileSystemAccess - for Flash Player 10 only, this Panel has a text field and two buttons: "Load Test" and "Test to save." The load test loads http://www.adobe.com in the text field and save him testing saves the content of the text field to BridgeTest.txt.

    To try signs, navigate the bin-debug for each project files with Bridge, the .swfs and .jsx files are there. Double-click the thumbnail for the .jsx and bridge must run the script and add the sign indicating the SWF file.

    -David

  • I am trying to convert a pdf to Word and continue to receive an error message "year error occurred during the attempt to access the service.  Any suggestions?

    I am trying to convert a pdf to Word and continue to receive an error message "year error occurred during the attempt to access the service.  Any suggestions?

    Hey lee,

    Are you still facing this problem?

    Have you tried accessing the service by using the browser: http://cloud.acrobat.com/exportpdf

    Kind regards
    Rahul

Maybe you are looking for

  • HP Slate 10 hd: how to delete downloads from HP Slate 10 HD

    Hello. It seems that I'm unable to download more documents on my tablet. The internal memory is full. How can I remove some of these documents, I need is no longer? Thank you.

  • script addon - new shortcuts

    If anyone is interested, I've created a macro script to give me some extended with the LabWindows IDE features.  It is written in AutoHotkey, compiles to a single EXE, weighing The two shortcuts perfom the following functions: (1) delete an entire li

  • I looks like the limit is 8 GB for HP Pavilion DV4-3030TX?

    I found that this pavilion can take 8 GB of RAM, depending on the specifications.  Just the confirmation. Thank you

  • walls out yellow

    I have an EOS Rebel SL1. I love the photo. but when I take pictures at my church, that the walls are yellow in the background. the topics are very good on the photo. It's just the walls. What can I do? I'm still learning abt the settings, IE. White b

  • Amazon MP3 download does not work on Windows Movie Maker

    My downloaded files before Amazon work very well, but I have downloaded a few today and tried to drop them into WMM and he gave me a generic message saying: could not be imported. I searched these cards, but suggestions have been 2009, and links for