COM in C++, but not in Labview shooting event

Hi all

Attached are on I have a problem with the screws.  The main VI is connection, which has a reminder VI which is testCallback methods.

The question, as I understand it, is that the OnGazeData event is not fired, because I created the recall VI to create and write to a file. However, the file is not created.

My first question is whether or not my shooting events will block waiting 500 SC in the loop.

I can't redistribute the .dll file that defines these functions, but I'll try to describe what did OnGazeData; the rest should be pretty self explanatory of the attached screw.

OnGazeData is fired whenever the connected device has data to interpret.  The data of the event will be a structure called gazeData.   There are a number of elements to the structure, including a timestamp as well as the size of pupil left and right eye.  All variables in the structure are either integers or floating-point numbers.

Curiously, the C++ code provided with the device works, as far as I know, in the same way as my connection VI.  Lights OnGazeData and the C++ program displays the results in a window.

In the end, I really wish I could use Labview to interpret the gazeData that OnGazeData fires, which is why the user setting (which will be eventually changed to a Variant or a cluster, I'm really not sure).

Is there something that stands out for you that could be the cause of the problems?  I realize it's hard to debug without the .dll real access to the same functions as I have.  I was banging my head against this VI for a few weeks now, and I'm really at a loss for what could be changed or improved now.

This is my first project in Labview, please forgive my ignorance.  Thank you for taking the time to look over what I have to say.

Re: GUID, IDL, COM server:

I think I mispoke in the title; I don't think that it is a COM event as long as it is a component.  I don't really know what a COM server is or how to find out if there is still an IDL.  The documentation I read is not a native English, and I'm having a hard time he deciphering at all.

So I guess my revised question should look like this:

  • How to find out if my structure is indeed declared as a struct with a GUID in the file of the COM server IDL
  • If not, can someone point me in the right direction regarding writing a wrapper .dll file, preferably one that easily fits into LV via .net or ActiveX).  Reminder, .net and ActiveX are all pretty new to me.

Hey Evan,

you don't mispoke not in the title, the COM server and COM event is correct. A bit on the functioning internal COM server:

COM servers are built using IDL files. IDL means "interface definition language", an IDL file is a text file that looks a bit like a C header file. It contains the interface definitions. Interfaces consist of properties and methods, ones that you can access through the property and invoke nodes of LV each interface has a GUID, a unique global identifier. The IDL file is compiled into a library of types, a binary representation of the IDL file. LV reads information from the interface and coclass type library. If you have Visual Studio installed you can view the type libraries using a tool called OleView.exe. So you might find if structs are used. Sounds complicated, but it's COM :-)

If you have to deal with types incompatible automation (e.g., struct) you need a wrapper. With a bit of luck you need not write C++ but can instead create a .NET DLL wrapper: The .NET SDK provides a tool Tlbimp can you use to accomplish this task. It is a command line tool that takes the name of the COM DLL as a parameter. After you create the interop with tlbimp DLL, you can use in LV. Structs are also exported as .NET objects, so you can create and access.

Hope that helps.

Tags: NI Software

Similar Questions

  • What should I do when I can communicate with my instrument NI MAX through other programs, but not of LabVIEW?

    Hi all, this is a question that I had a few times before in one form or another.

    I use a Boxcar Integrator (245 SRS is the interface) for my experience. I connect to it via GPIB using my Agilent GPIB/USB interface. My program runs in LabVIEW, and I used it successfully in the (very recent) past.

    However, sometimes if I get LabVIEW or something, some weird stuff starts past trying to connect to it. For example, after the LV exit and go back to the top and any attempt to run my program, it throws the error:

    Error 1073807339 has occurred in the CITATION read in OR_Boxcar_ReadAnalogPort3.vi-> OR_Boxcar_SimpleTest.vi

    Possible reasons:

    VISA: (Hex 0xBFFF0015) timeout expired before the operation is complete.

    Which essentially means that he cannot connect for some reason or another (don't worry, I'm on the right GPIB address).

    So I go to equivalent NI MAX or Agilent (Keysight connection Expert), proceed to part communication from VISA to either and manually, connect with the machine. And it works! If clear my computer is communicating with the machine at this point, but not of LabVIEW.

    This could be the cause, and what I might try? Thank you!

    Oh shit, I forgot about it! I solved the problem, it was actually a 'me' problem is not a problem of LV. Even my solution would not be to help someone else who finds it. I was trying to read from my instrument, but it is in synchronous mode, so it generates an error if you try to read her when a data point has not been loaded in its buffer. I did something unusual, so it was not a point of data loaded into its buffer.

  • Why did the counter works in MAX, but not of Labview?

    Please help, I've been away from Labview for more than 3 months and I'm pretty rusty...

    Last year, I configured successfully NI9401 to measure the period (in seconds) by counting the rising edges of my sensor signal.  Since then, I bought a new PC and loaded all my software inside, including the Labview VI that has worked successfully on the old computer.

    I can see the digital signal using MAX and test for the NI9401 Panel, then, I know that my son and my TTL signal is OK, but nothing except the below error when I try to run the attached VI, happens...  How can I say this VI to search for the signal on channel 14 and MOD3/CTR0?

    Thank you. I'm sure it's a small adjustment... it worked well a few months ago... do not know what the problem is now.

    Thank you

    Dave

    OK, now.  Solved the problem. The vi is fine, but some fragile son have been identified... worked in MAX but not in vi.  Now that the connections have been tightened, it works for both.  Sorry for the inconvenience.

    Dave

  • Serial via NIMAX okay but not through LabView

    I'm trying to communicate with a device via the serial port.  In MAX, I have configured the port (28800, 8, N-2, RTS/CTS).  In the test Panel, I can send a request for identification (ID? \r) and get an answer.  If I try this through a LabView VI, where I open a session VISA, set the COM port settings, and then try the request ID, I don't get a response.

    I have also noticed that if I try the query ID in MAX, but use a USB-serial adapter, I get no response.

    I don't know I'm missing a few simple nuace serial communication.  Any thoughts?

    Thank you.

    In LabVIEW, my guess is that you do not correctly send the \r. To do this, you must have the control/constant string defined for '-' code display. If you had posted your code, it would have helped to see if this or something else is wrong. Have you tried one of the sample programs before you try to write your own?

    I've never had a problem with an USB-RS232 adapter. The new port is actually in MAX and you can use Hyperterminal with it?

  • My Satellite L30-101/XP sound comes from headphones but not pregnant

    I have a black XP newly installed on my system and installed everything except the sound does not come from the speakers but when I use headphones sound works perfectly. I thought it was problem with XP, so I then installed Vista but still the same problem.

    Then I went back to XP because I'm more comfortable with it.

    PLS HELP >

    Hmm. Maybe there is something wrong with the speaker system?
    I mean if you can hear the sound using headphones then your sound driver and sound card should work properly.

    Did you also check the settings in Realtek HD audio Manager?
    On the right, you can find the settings for the helmet. Please check what options is enabled or disabled.

  • Reading to the MAX but not of LabVIEW

    Hello

    I have a very difficult problem to read four counters of a NI 9401. In MAX, they read very well but in LabVIEW, they read zero. I scoured the internet and discussion boards and can't find anything on it. Please forgive me if this is a simple thing to fix. IM attaching two png which shows where I read meters and a picture of my task. I know that the VI everything would work better but I'm not posting my project as a whole.  I fixed it where some of the forum posts I found said have it better. Any help would be great. If you need a certain thing just let me know.

    Kind regards

    caleb1993

    I create now these tasks in LV I always not to read. I hope someone has assured this problem in the past and resolved. If yiu have a better idea then by testing each port call please let me know

    Thank you

    caleb1993

  • Camera works to the MAX, but not in LabVIEW

    I struggled a lot with getting a camera DCC3240M of Thorlabs working in LabVIEW. The software supplied (Thorcam) works as it should. However, the LabVIEW SDK does not work as it should, it gives an error 155 "the operation is not supported.

    Instead of the SDK software, I tried the drivers for DirectShow and now the camera arrives in MAX and works as it should. He also appears with IMAQdx list Cameras.vi and in Vision Acquisition Express vi. BUT when I try to run IMAQdx open Camera.vi or the Express vi it does not work. Open device gives a DirectShow error code 0 x 80040275 "no capture hardware is available, or the hardware is not responding." And when I try to select the camera in the express vi, a red icon is displayed and I can only choose "Cancel":

    It's really very annoying that the camera obviously work with the drivers provided, but I can't use it in LabVIEW.

    I would be grateful for any ideas what is wrong. I'm running LabVIEW 32 bit on 64 bit Win8.1.

    Problem solved!

    I carefully removed all the drivers that came with the camera and then I installed the drivers from manufacturers (IDS) instead of Thorlabs drivers. And now it works, the camera always appears in MAX and it does not work. But now the supplied screw. I'm so happy. It took me a week to understand.

  • communication serial port works to the max, but not in labview

    Hello

    I am trying to connect a regulator to oxygen flow (flow Bronkhorst EL) to a laptop through a USB using MAX and Labview series port adapter. After the MAX aperture, I see my instrument on port COM5 and need to change the baud rate to 9600 to 38400. After this I querry the command: 06030101217D00\r\n, I can turn the mass flow at maximum power regulator (looks a little weird order because of the syntax of the instrument, but it works very well). If I write a vi to do the same and send the same string through visa series, I get no results, it seems that the command is not send to the device. I tried to change all settings for the serial port, nothing seems to work.

    I've attached an example vi here, any suggestions?

    Hello

    just a simple misunderstanding, happy that you added the code.

    In MAX \r\n will be always interpreted as send a cr and line break.

    In LabVIEW only when you select \codes view by right-clicking on the channel.

    In your situation, it now sends a-a r another- and a n

  • FireWire camera works to the MAX, but not in LabView

    Hello

    I use a 1394b (grey Grasshopper Point 14S5M-C) camera connected to a 1394 bus controller. In MAX, the camera works fine, but it will not work with all files of 1394-example LabView. These allways throw the error "NOR-IMAQ IEEE-1394: (Hex 0xBFF6800F) attribute not supported by the camera" even if some of these example like "grab.vi" files no attributes are defined at all. On the same computer, another device (Point Grey Scorpion 20SOM, 1394 (a) works without any problem.

    Can anyone help?

    Hi Christian,

    Thanks for this tip, this is the reason. I was unintentionally using the IMAQ instead of example IMAQdx files. With IMAQdx it works now.

    Best regards

    Karl

  • NEITHER USB-9162 driver works for MAX and SignalExpress, but not for LabView

    Hello

    I looked for a solution for a while now. According to Web sites OR the NI USB-9162 is compatible with LabView 2012. I installed the last DAQmx. My hardware has been detected and is sensitive to MAX and works very well in LabView Signal Express. But it is not detected in LabView 2012. I searched the forum and not found any solution other then all uninstallation and reinstallation of any. It is quite conssuming time and would rather avoid if possible. Anyone have a solution? I wish I could appreciate.

    Tool:

    NEITHER USB-9162

    NEITHER RIO-9215

    Benjamin

    I reinstalled everything, and now I can work with it. I can't say that I was wrong on the first time, but now it works very well as well as other bugs that are now set.

    Thank you for your answers

  • Unit works fine with MAx but not with Labview visa series

    I have a RPM sensor connected to tachometer Monarch monarch, it gives error while coding in labview and works very well in Max if the sensor does not read 0. I wrote RS-232 simple programs never had an error, but this one's errors... not ablt remedy... Help, please

    Hello

    I solved it by using bytes to the port if there is anything in the port, I read it otherwise, he simply says no playback.

  • Target visible FPGA in MAX but not in LabVIEW

    Hey!

    I recently installed a RIO device. Before installing the equipment, I installed the module FPGA & RIO 3.0 as directed. Now, I can see the device in a position & automation explorer, but its not in list "Add target & devices. It says "No device found" in the existing devices tab. I don't understand the problem. :/

    Add the target under 'my computer '.

    Christian

  • LogFilter creating alarms, but not email action shooter

    Hello

    I came across a problem of "e-mail action" today as he tried to implement the rule of the Logfilter agent. I copied the outside "LogFilter' box and personalized just rule to change the email address.

    The address that I use is the same I have been receving emails everyday with success on other rules.

    I also see alarms, created by the Logfilter rule, but action will not fire.

    I have fire action on 1 consecutive evaluation with a schedule of "Always". I don't know where is the problem. I tried to create a support package to look at where the e-mail action is a failure, but did not.

    Please can someone help?

    Thank you very much!

    APO - Barro

    This is the condition

    checkObservationAlarms (#LogFilter_ErrorVerbose to 1ms #,)

    {the entry->

    If (entry.get ("Severity") == "WARNING") {}

    return 2;

    }

    If (entry.get ("Severity") == 'CRITICAL') {}

    return 3;

    }

    If (entry.get ("Severity") == "FATAL") {}

    return 4;

    }

    return 0;

    },

    {entry, severity-> {switch (severity)}

    case 2:

    return "" + entry.get ("LogName") + ":" + entry.get ("Error_Message") + ""; ""

    case 3:

    return "" + entry.get ("LogName") + ":" + entry.get ("Error_Message") + ""; ""

    case 4:

    return "" + entry.get ("LogName") + ":" + entry.get ("Error_Message") + ""; ""

    by default:

    Return ' ';

    }}, "542c111ff5feabe3803bccb722386cae") () .size > 0;

    And "text" variable of severity assessment

    createObservationAlarms (#LogFilter_ErrorVerbose to 1ms #,)

    {the entry->

    If (entry.get ("Severity") == "WARNING") {}

    return 2;

    }

    If (entry.get ("Severity") == 'CRITICAL') {}

    return 3;

    }

    If (entry.get ("Severity") == "FATAL") {}

    return 4;

    }

    return 0;

    },

    {entry, severity-> {switch (severity)}

    case 2:

    return "" + entry.get ("LogName") + ":" + entry.get ("Error_Message") + ""; ""

    case 3:

    return "" + entry.get ("LogName") + ":" + entry.get ("Error_Message") + ""; ""

    case 4:

    return "" + entry.get ("LogName") + ":" + entry.get ("Error_Message") + ""; ""

    by default:

    Return ' ';

    }}, "542c111ff5feabe3803bccb722386cae");

    When you have copied the LogFilter rule, have you changed the id of the rule which is in the last line of the State? If you do not change this rule id, the copied rule will not be triggered.

  • Blackfin Timed loop works in VDSP ++ with .dxe but not in Labview

    Hello

    I have a loop that is timed with a period of 4ms that turns the LED on and.

    My oscilloscope shows that the LED * s are enabled for 5ms, that turnd off for 45ms, enabled for 5ms, that turnd off for 45ms,... and so on.

    If I load dxe file in VDSP ++ all the lights blink every 5ms.

    I use LV integrated 8.6 evaluation

    Problem solved

    Source name: 1 MHz

    Priority: 27

  • USB thermometer works in Hyperterminal & MAX, but not in my VI

    I have USB (Omega TJ - USB) thermometer.  I contacted with her success in Hyperterminal.  When I try with MAX, it usually starts working after the second attempt to read/write.  But even if I put the termchar 0xD and termchar_en to True, I still have to type my writing as 'C' back ' 20.2 c ' (20.2 C being the temperature) any idea why this happens?

    In addition, I go ahead and make my VI, very similar to that found in the labview tutorial - image shown here: http://zone.ni.com/cms/images/devzone/tut/a/e09bfd41228.gif I put it for baud: 38400, 8n1.  and I also write 'c', but I get the error 1073807339.  I tried to change the buffer without change in the results.

    I thought it would be a relatively simple task, but it seems that I am bad, or overlooking something simple.

    Hi Chknrckd,

    Also what could be the problem, is that the way hyperterminal sends characters (when you type words). LabVIEW will send a string at the same time, while that hyperterminal sends each character at a time.

    More information can be found here:

    Why Test panels MAX works my Instrument Serial in Hyperterminal but not in LabVIEW or VISA work?

    http://digital.NI.com/public.nsf/allkb/171D2D70CFB66E74862571390062D12B

    I hope this helps!

Maybe you are looking for