Using NI 9205 to detect Break in Light Curtain

I am trying to use a NI 9205 in a NI cDAQ-9178 to do two tasks. The first is to continously check for a +4 VDC on one channel the second is to check for the potential of another channel. The +4VDC is run through a safety relay and will singnal the machine to go to a 'STOP' state when a light curtain is broke. I want this to be checked at least once every iteration of my main While Loop. The second channel of the 9205 will be used on during the 'Rotation' State. I have found when I try to use the DAQ Assist in a parallel or series loop the DAQ Assist errors out when it gets to the 'Rotation' State.
Should I only use a DAQ assistant once with the 9205?
How could I best accomplish this in my program?
Attachments:
AC TEST PANEL.vi ‏544 KB

Hi MwMonty,
What error do you get from the DAQ Assistant? In terms of looking at each channel individually, you can use the Split Signals function in the Express>>Signal Manipulation section of the Functions palette.
Tunde S.
Applications Engineer
National Instruments

Similar Messages

  • Using NI-VISA to detect USB insertion/​removal

    Is there a way to use NI-VISA to detect when a USB device has been inserted or removed?
    I am currently using Windows API in my LabWindows application to capture the WM_DEVICECHANGE event.  When this event is called, I check to see if the USB devices are still connected to my PC  by using viFindRsrc function.  On Windows XP 32-bit, this approached worked successfully.  On my Windows 7 64-bit system this is no longer working.  After I remove the USB device, the viFindRsrc function is still indicating that the device is connected even though it isn't. 
    Also, when a USB device is controlled by a NI-VISA driver, I cannot capture the Windows DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE events.  I am able to see these events for other USB devices that are not controlled by a NI-VISA driver.
    Solved!
    Go to Solution.

    I solved the issue.
    The behavior of the NI-VISA driver requires that you register to receive Windows notifications. The other USB devices that weren't controlled by a NI-VISA driver didn't require me to register to receive the DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE events.  I received them by default...
    Here is the code to register USB events
    Here is the code where I register the USB events:
    DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
    intptr_t postHandle = 0;
    /* Windows HWND */
    HWND hWnd = 0;
    long long unsigned int hWndVal = 0;
    /* Get HWND of LabWindows\CVI panel */
    GetPanelAttribute(panelHandle,ATTR_SYSTEM_WINDOW_H​ANDLE,&hWndVal);
    hWnd = (HWND)hWndVal;
    * USB Raw Device
    * Device Interface Class GUID = {a5dcbf10-6530-11d2-901f-00c04fb951ed}
    GUID_CLASS_USB_DEVICE.Data1 = 0xA5DCBF10L;
    GUID_CLASS_USB_DEVICE.Data2 = 0x6530;
    GUID_CLASS_USB_DEVICE.Data3 = 0x11D2;
    GUID_CLASS_USB_DEVICE.Data4[0] = 0x90;
    GUID_CLASS_USB_DEVICE.Data4[1] = 0x1F;
    GUID_CLASS_USB_DEVICE.Data4[2] = 0x00;
    GUID_CLASS_USB_DEVICE.Data4[3] = 0xC0;
    GUID_CLASS_USB_DEVICE.Data4[4] = 0x4F;
    GUID_CLASS_USB_DEVICE.Data4[5] = 0xB9;
    GUID_CLASS_USB_DEVICE.Data4[6] = 0x51;
    GUID_CLASS_USB_DEVICE.Data4[7] = 0xED;
    NotificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
    NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
    NotificationFilter.dbcc_classguid = GUID_CLASS_USB_DEVICE;
    * Installs a callback function for WM_DEVICECHANGE Windows message posted
    * or sent to a LabWindows/CVI panel.
    InstallWinMsgCallback (panelHandle, WM_DEVICECHANGE,
    WindowsDeviceDetection, VAL_MODE_INTERCEPT, NULL, &postHandle);
    * Register device notification for USB Raw Device interface class GUID
    RegisterDeviceNotification(hWnd, &NotificationFilter,
    DEVICE_NOTIFY_WINDOW_HANDLE);
    Here is the code that responds:
    static int CVICALLBACK WindowsDeviceDetection (int panelHandle, int message,
    unsigned int* wParam, unsigned int* lParam, void* callbackData)
    PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)lParam;
    switch (message)
    /* Received Windows WM_DEVICECHANGE message */
    case WM_DEVICECHANGE:
    switch (*wParam)
    * Received Windows device-change event "DBT_DEVNODES_CHANGED".
    * Device has been added or removed from the system.
    case DBT_DEVNODES_CHANGED:
    printf("[%s] DBT_DEVNODES_CHANGED\n",TimeStr());
    break;
    * Received Windows device-change event "DBT_DEVICEARRIVAL".
    case DBT_DEVICEARRIVAL:
    printf("[%s] DBT_DEVICEARRIVAL\n",TimeStr());
    break;
    * Received Windows device-change event "DBT_DEVICEREMOVECOMPLETE".
    case DBT_DEVICEREMOVECOMPLETE:
    printf("[%s] DBT_DEVICEREMOVECOMPLETE\n",TimeStr());
    break;
    default:
    break;
    return 0;

  • Error in Detect Break event.vi

    Hey friend,
    As you can see i have just opened an example detect break event.vi.
    The error is"Wite class conflict".
    Please help me on this.
    I have a program which uses thisVI.that program is showing the warning
    " This VI needs a driver or toolkit component that is not found. Missing resource file "visarc"."
    please help me on this.
    Solved!
    Go to Solution.
    Attachments:
    detect break.pdf ‏65 KB

    yes i have NI-VISA . .
    I am using 8.6 verision of LAbview

  • Using network data to detect DPI

    "Network transparency cuts both ways. It can be exploited to engage in surveillance of Internet service providers as well as Internet users. In order to better understand DPI use and the scope of its deployment, the project makes use of crowdsourced network monitoring data. So far, we have used data from a test known as Glasnost, which was developed by German researchers to detect blocking or throttling of BitTorrent and other peer to peer (P2P) file sharing protocols. The detailed workings of the Glasnost test are described in Dischinger, Marcon, et al (2010)."
    using network data to detect dpi
    Use tools running on M-Lab to test your Internet connection.

    John the point being that DPI would need to be used based on what the post says to keep it unthrottled.
    It's DPI that is the privacy concern not throtteling so BT's use of DPI which may be increasing is a concern not least since they have been known to run 'tests' of dubious legality before now (Phorm or some such as I recall)
    If my post was helpful then please click on the Ratings star on the left-hand side If the the reply answers your question fully then please select ’Mark as Accepted Solution’

  • Using a 9205 to measure RPM

    I have not used labview in over 10 years but now have an application that requires but I am more then rusty. I am trying to measure RPM using a 9205 module and I am sure there is a way to do it. I have a pulsed voltage output from my measurement circuit and so far I am capturing the voltage. Can someone suggest a way to convert these voltage pulses to an RPM value. I am sure some type of leading edge counter would work.
    Thanks

    Not the cheapest route but there is a SCXI card that measures frquency.
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/1661
    There may be some other frequency cards this is one I have used in the past.  With this card you can create a virtual channel and ask it what frequency the analog signal is going into it.  From here there is a conversion from frequency to RPM depending on the type of resolver or hall signal you are using to generate that signal.
    This method is the easiest but the cheapest would be to get a cheap AI DAQ device that can measure several times faster than the generated signal (nyquist theorem) then analyze the series of AI reads to determine the frequency.  Then convert frequency to RPM.  Depending on the signal a USB DAQ device might work, if not a PCI or PXI + MXI card would still probably be cheaper than the SCXI route.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Use of AUTOMATIC SCENE DETECTION on already existing huge file

    Hello to all for the first time,
    I have 6 HUGE already imported video files of my videos diary from Himalaya, so they are each 1 hour long files now and to edit the story I need to brake each of those HUGE imported files into individual clips!!!
    Of course I can make new smaller clips manualy but my TIME SAVING question here is how can I make iMovieHD AUTOMATIC SCENE DETECTION work on already imported huge file? So that I just play the HUGE file and it automatically brakes the individual clips and makes different files/clips.
    Got it?
    Hope somebody into the know will read this.
    Thank you
    Vladan
    G 4 titanium   Mac OS X (10.4.9)   love it

    Thank you Sue,
    Thank you for wellcome, great you want to help.
    So I imported all my video (from Hi8 - remember) trough firewire in using iMovieHD ... and that is how I got here where I have those huge documents, each 20 Gigs, on my external drive.
    so thats where I am at and I would like to RETROACTIVLY (I quess) use that automatic scene detection and out of one huge file (clip) get say 15 smaller clips.
    Is that clearer
    thanks again
    Vladan
    G 4 titanium   Mac OS X (10.4.9)   love it

  • I would like to create the same mouse over effect that is used on the home page of Industrial Light

    I would like to create the same mouse over effect that is used on the home page of Industrial Light & Magic website. http://ilm.com
    Could someone please let me know what the code or effect that is used. Thanks.

    It appears there are two slideshows running in parallel where a mask that follows the mouse displays one of them.  THe one you see in the moving mask is on top of the other.
    If you were to search Google for a custom cursor tutorial you will probably end up with most of what you need for getting the mask to follow the mouse.  

  • HT1267 Can i use Ui setting without jail break my ipnone 4?

    Can i use Ui setting without jail break my ipnone 4?

    What UI setting? Jailbreaking would be a very bad idea.

  • Detect break off DB connection

    Hi
    I am using Labview 7.1, LabSQl and MySQL.
    Is there a way to detect the break off in the database connection in the event case while my program is performing  other tests?
    Clement

    Normal operation procedure is to open and close the connection every time
    you communicate with the database. If you work like that, you will get an
    error if it is not possible to establish a connection. In any case, you'll
    receive an error if the connection is broken, and you can act on that, for
    instance by popping up a message, logging the error, or storing the failed
    query in a buffer to retry later.
    Regards,
    Wiebe.

  • I cannot connect on WiFi using my Airport Express even though the light is green

    Why can't I connect via WiFi even though my Airport Express shows a green light?

    Hi Jose,
    Thanks for visiting Apple Support Communities.
    If you can't connect to your wireless network, trying these steps first can help to isolate the issue:
    Check your range to the Wi-Fi router and reduce the effect of interference.If your computer is too far from your Wi-Fi router or your environment has too much Wi-Fi interference, then your computer may not detect the Wi-Fi network properly. The easiest way to check for range limits with your Wi-Fi network is to move your computer or your Wi-Fi router closer together and make sure that there are no obstructions (such as walls, cabinets, and so forth) between the router and your computer.See Potential sources of wireless interference for more information about interference and solutions.
    Try connecting to a different Wi-Fi network. If your computer works fine when connected to a different Wi-Fi network, then the issue may be related to your network router...
    See the full article for more troubleshooting steps:
    Wi-Fi: How to troubleshoot Wi-Fi connectivity
    http://support.apple.com/kb/HT4628
    If you're using an iOS device, see this article as well:
    iOS: Wi-Fi settings grayed out or dim
    http://support.apple.com/kb/ts1559
    Best,
    Jeremy

  • Using Javascript to generate dropdown breaks task menu

    I am trying to use the Cloud Portal to create a workflow that retrieves some data from external web sources to populate some of the form fields. I cannot use the internal based Database connection as the data is likely to change very frequently and is dynamic based on the user logged in. I have managed to get a bit of javascript code working that populates a dropdown on a form and so I can submit the data I want. The problem is that when I activate the Javascript, it breaks the Task view (via Service Manager) and prevents the right hand list to be built. This in turn prevents me from completing the checklist and so prevents the task from proceding. If I disable the javascript, the page loads fine.
    The function I am using is below that puls in some JSON formatted data.
    myfunction(){
    var select = document.getElementById("VLANDetails.Deployment_Version");
    $.getJSON("/software_catalog", function(data) {
        $.each(data.devmap, function(i, id) {
            $(select).append($('<option/>').attr("value", data.devmap[i].id).text(data.devmap[i].name));
    Has anyone seen anything similar to this or can see what I am doing wrong.
    Thanks in advance
    Mohammed Rakhada

    Hi Sachin,
    Before I read you reply, I had a "Eureka" moment that I was about to write about.  I got my Javascipt to read my the value that was set in the Filterdropdown!  However, you somewhat burst my balloon with the revelation about how re-sizing
    window changes their size (i.e., Large to Medium, etc)?  It is true, my function does not work when I click the "restore down" icon on the upper right corner of my window, then it works again when I maximize the window.  That sucks : (
         Oh, well.  Thanks just the same!
    For what it is worth, here is the script I wrote:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
        <script language="javascript">
            //This function reads the digest using /contextinfo.
            function ShowAlert()
                alert(document.getElementById("Ribbon.ContextualTabs.MyWork.Home.Data-Large-2-1").textContent);
        </script>
    </head>
    <body>
    What filter am I set to?  Click the Button snd I will tell you... <input type="button" value="Button" onclick="ShowAlert()";/>
    </body>
    </html>
    \Spiro Theopoulos PMP, MCITP. Montreal, QC (Canada)

  • How to do detection of pulsating light (eg torch light)

    Hi all,
    I am trying a application where i need to do intensity based object detection. The inputs provided for the algorithm are threshold intensity, object size(minimum 3 to 100 pixels) and  pulsating (that is torch light is on in one frame and off in next frame). 
    I have already tried imaq threshold, particle filter and particle analysis to perform detection and draw bounding box for the detected object. But my problem is how to extend this algorithm for marking bounding box for only pulsating (blinking) light object.
    I have thought of frame differencing but i dont know the way to do it in labview and i am worried of the lag in the output video.
    So kindly help me out with better idea to achieve it.
    with regards,
    Sri

    Hello,
    in this case you could try the following:
    1. take a reference image when all stationary lights are ON and the blinking light is OFF,
    2. in every frame, subtract the reference frame from the current frame,
    3. threshold the image,
    4. (do some morphological operations to filter out the noisy pixels, e.g. erosion),
    5. if the blinking light is on, the thresholded image should show a distinct region that is the result of image subtraction.
    Anyway, if your blinking light is stationary, why not thresholding only in the region of the blinking light? You could select the region of interest once at the beginning or is this not a possibility?
    Best regards,

    https://decibel.ni.com/content/blogs/kl3m3n
    "Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."

  • Using a counter to detect frequency

    I have an application that basically needs to run as fast as possible given an input signal from a sensor on a vehicle. This frequency I get can range from 300 Hz to 2.2 kHz. I am also sensing three other analog inputs. This is how the vi should work:
    1. Input signal is passed to DAQ board counter (GPCTR0_GATE). The counter is configured to count on each rising edge.
    2. When a rising edge is detected, sample the three analog input channels and dump these values to a buffer (array).
    3. Capture the period of the input signal at the same time I'm getting the three analog channels, dump this to the buffer as well.
    4. Continue this process until a stop button is pressed.
    5. When the test has completed, copy the buffer to a database.
    Basically, what we're trying to do is capture readings based on an external clock that can vary with speed. While testing the application I wrote, I've noticed some serious problems, and this is where I need some expert advice on how to handle them. If the input frequency were constant at 1 kHz, and the test was run for exactly 10 seconds, I would expect to see 10,000 data readings copied to the database (in a perfect world, at least). What I get depends on whether or not I'm requesting the period of the input signal - if I only request the three analog input channels, then I get around 10,000 data points. If I request the period as well as the three analog channels, then I may get 20% (2000 data points) - and the period is wrong at the lower frequencies (300 Hz to 900 Hz).
    I'm at a loss here. I've written this using traditional NI-DAQ as well as with DAQmx. Neither one gives me the input period right, and the number of data points captured decrease significantly when I try to get the period. I've looked a the examples, used alot of the examples, but still no luck. Any help would be greatly appreciated.
    My configuration:
    LabVIEW 7.1
    PCI-6014 on the PC and a DAQCard-6062E on the laptop
    Windows XP

    Hello,
    I do think that a higher performance card would help you significantly in your application. Something like a Value M Series (NI 622x) might solve the problem since it offers 6 DMA channels. If you are able to strip down your program such that it is the easiest piece of functioning code that demonstrates the behavior you would like to see, I could give it a test run on an M Series device and let you know how things turn out. I would need the DAQmx code in order to do this since M Series do not support Traditional NI-DAQ.
    Another thing that I found interesting about your post is that the examples were not ever working for you. I would suggest trying the Meas Dig Period-Low Freq 1 Ctr.vi in the DAQmx examples to see if you are able to successfully measure the frequency of your signal. If that's not working, then it might be an issue with the signal that you are connecting up. You should confirm that the signal is TTL compliant and possibly even probe the signal to confirm you are receiving what you are expecting.
    Post back with your thoughts and code if you'd like.
    Jared A

  • Using a selector to detect closed socket channel.

    Basically our app uses one thread to perform a select on multiple socket channels. When a socket is closed (either remotely or locally) the server app needs to unregister the client (so we need to detect closed channels). We've been using blocking IO previously (no dramas), but now we're dealing with many connections/clients we need to rework it as we're getting excessive amounts of threads. Anyway, that's just background.
    Here's the problem we're getting, I have boiled it down to the following.
    SocketChannel channel = SocketChannel.open();
    channel.connect(socketAddress); // for the test this is localhost.
    // this make sure socket is open, remote end just echos, waits 3 seconds and closes the socket.
    channel.write(ByteBuffer.wrap("testLocalSocketClose\n".getBytes()));
    channel.configureBlocking(false);
    Selector selector = Selector.open();
    LOG.fine("registering channel");
    channel.register(selector, SelectionKey.OP_READ, channel);
    LOG.fine("closing channel");
    channel.close();
    LOG.fine("waiting...");
    int i = selector.select();
    // this never happens (or it does very rarely)
    LOG.fine("selector woke with " + i + " selected");I would have expected the selector to return the selection key of the dead channel. Given that it doesn't and this scenario is possible (channel closing just after a read operation but before another select is called - in separate threads obviously). How can we reliably detect/be informed that the channel has been closed?
    (I saw somewhere someone mention adding the OP_WRITE to the key, I have tried this as well and it makes no difference).
    Many Thanks.
    Bob.

    May I suggest you look at your application and reassess; either it's wrong or it's your understanding of what our issue is.
    Please try the simple test below.
    WSADATA ws;
    WSAStartup(0x0101, &ws);
    SOCKET sock = socket(PF_INET, SOCK_STREAM, 0);
    struct sockaddr_in server;
    server.sin_family = AF_INET;
    server.sin_addr.s_addr = htonl(INADDR_ANY);
    server.sin_port = htons(9000);
    cout << "binding" << endl;
    bind(sock, (struct sockaddr *)&server, sizeof(server));
    cout << "listening" << endl;
    listen(sock, SOMAXCONN);
    struct sockaddr_in client;
    int client_size = sizeof(client);
    memset(&client, 0, client_size);
    cout << "accepting" << endl;
    SOCKET clientSock = accept(sock, (struct sockaddr*)&client, &client_size);
    // shutdown socket.
    cout << "shutting down client socket" << endl;
    shutdown(clientSock, SD_BOTH);
    // setup select
    FD_SET fd;
    TIMEVAL tv;
    FD_ZERO(&fd);
    tv.tv_sec  = static_cast<int>(6000);
    tv.tv_usec = 0;
    FD_SET(clientSock, &fd);
    cout << "selecting" << endl;
    int rc = select(0, &fd, NULL, NULL, &tv);     
    cout << rc << ", " << FD_ISSET(clientSock, &fd) << endl;
    char msg[500];
    if (FD_ISSET(clientSock, &fd)) {
         cout << recv(clientSock, msg, 500, 0) << endl;
         cout << WSAGetLastError() << endl;
    cout << "closing" << endl;
    closesocket(clientSock);Telnet to port 9000, you get the following output immediately:
    binding
    listening
    accepting
    shutting down client socket
    selecting
    1, 1
    -1
    10058
    closing
    The solution I posted previously re calling shutdownInput/Output in Java isn't correct however, I left OP_WRITE on by mistake, which always returns ready, my fault.  Apologies.
    Whatever the behaviour, it will be the same for Selector.select() as it is for select().
    Clearly not.
    Edited by: Bawb on 29-Jul-2011 07:01, I had left OP_WRITE on which was returning ready each time, when I realised and took it out I removed the shutdown code which made me think I hadn't sorted this. Apologies again.
    Still reckon an RFE for OP_SHUTDOWN should be added to Java.
    Thanks.

  • Using the equivalent of a BREAK ON command in SQL Developer SQL window

    Folks.
    In SQL*PLUS "BREAK ON Col1 ON Col2;", I can generate a report similar to the following:
    Col1Value1 Col2Value1 Col3Value1
    Col3Value2
    Col3Value3
    Col2Value2 Col3Value1
    Col3Value2
    Col3Value3
    Col1Value2 Col2Value1 Col3Value1
    Col3Value2
    Col3Value3
    Col2Value2 Col3Value1
    Col3Value2
    Col3Value3
    etc.
    I want to be able to do the same thing in my SQL Developer SQL window so that I can export the results to a spreadsheet file.
    Does anyone know if this is possible?
    I've tried using the SQL*PLUS BREAK command in my SQL Developer window but it appears to be ignored. My resultset looks something like
    Col1Value1 Col2Value1 Col3Value1
    Col1Value1 Col2Value1 Col3Value2
    Col1Value1 Col2Value1 Col3Value3
    Col1Value1 Col2Value2 Col3Value1
    Col1Value1 Col2Value2 Col3Value2
    Col1Value1 Col2Value2 Col3Value3
    Col1Value2 Col2Value1 Col3Value1
    Col1Value2 Col2Value1 Col3Value2
    Col1Value2 Col2Value1 Col3Value3
    Col1Value2 Col2Value2 Col3Value1
    Col1Value2 Col2Value2 Col3Value2
    Col1Value2 Col2Value2 Col3Value3
    .

    OK thanks.
    I did get around this by using SQL*PLUS to generate an output file with a separation character between the columns and spooling the SQL*PLUS output to a text file.
    I then open the text file with Excel and specify the same character as a column separator. Seems to load properly into Excel.

Maybe you are looking for

  • Adobe CS2 / 10.4 Printing problem - Fonts

    I have a studio with 30+ Macs (one of many ) using CS2 printing to Xerox RIP's or PS files Distilled. The issue being parts of words not appearing on the prints. We have said it's the fonts, we've said it's this and or that but the only thing I can p

  • Error when launching Robohelp

    Does anyone know what this error means? I get it when launching robohelp right before the program opens. "Unable to register hhctrl.ocx, itss.dll. If you experience any adverse behavior, please make sure you have sufficient rights and restart the pro

  • Running 5 commands using array elements and waiting between?

    Hi All, Trying to learn PS so please be patient with me ;) System: PSv3 on Win2012 server running WSUS role I am wanting to execute 5 commands using a 'foreach' loop but wait until one finishes before moving onto the next. Can you please check out wh

  • Authorize-deauthorize circle

    Another member of my household recently purchased a 15" MacBook Pro POST mid-2010, that is, a laptop whose mini displayport outputs audio as well as video. I would like to display the videos purchased in iTunes from his laptop to our HDTV. We have th

  • Using Crystal Reports 2008 SP3 with the Brother 9500PC, 9700PC, and P9800PC

    We have using Crystal Reports with the Brother Label printers for years until we were forced to use Crystal 2008.  The label printers have worked in the past and we usually create a label template in the printer driver and this configuration is store