Is NI-CAN v2.3 & NI PCI-CAN/XS2 with Frame API Thread Safe?

Hi, I'm downloading a file from the host computer to the modules. When I downloaded the data to the four module at the same time (with 4 threads), I'm getting communication failure ~ 20% of the time. When I synchronized the software, so it will download two modules at a time (using one port from each card at a time). The communication failure disappeared. I just wonder if the NI-CAN software & PCI-CAN/XS2 are thread-safe. I'd appreciate if anyone have any suggestion.
Information of the software & hardware
- Computer: Pentium4 2.8GHz, 512M Ram
- OS: Windows 2000
- Development Tool: Borland C++ Builder v5
- NI-CAN v2.3 - The application is using Frame API
- PCI-CAN/XS2 (SW-Selectable CAN, 2 Ports)
- CAN bus: 500k High Speed
Thanks
Eric

The NI-CAN software does support threads. What's the specific error
you're getting that 20% of the time? It may be due to something besides
the multi-threading.
Regards,
Matt S.
LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.

Similar Messages

  • Filtering can frames with frame api (part 1)

    Hello,
    I have problems to understand the filter techniques in the frame api for C/C++.
    My current structure is as follows:
    - I have a NI CAN Card (Series 2 HW, Philips SAJ 1000 Contoller, 1 CAN Interface (CAN0))
    - On the CAN BUS Interface one target device is connected (it is a controlling unit for a sliding gate, automotive)
    - I 've created 2 CAN Network Interface Objects, one for receiving, another for transmitting frames
    - all received Frames from the target (incomming frames) are handled by the receiving Object.
    - its configuration is as follows:
    m_attrList[0] =       NC_ATTR_BAUD_RATE;
                m_valueList[0] =    83333; //CC.NC_BAUD_100K;
    m_attrList[1] =      
    NC_ATTR_START_ON_OPEN;
                m_valueList[1] =    NC_TRUE;
    m_attrList[2] =       NC_ATTR_READ_Q_LEN;
    m_valueList[2] =    0; //number of frames (not bytes!)
    m_attrList[3] =       NC_ATTR_WRITE_Q_LEN;
                m_valueList[3] =    0;
    m_attrList[4] =       NC_ATTR_COMP_STD;
    m_valueList[4] =    NC_CAN_ARBID_NONE; //handle all
    frames that are not handled trough CANObjects
    //CC.NC_MASK_STD_DONTCARE;//0x791;
    m_attrList[5] =       NC_ATTR_MASK_STD;
    m_valueList[5] =    NC_MASK_STD_DONTCARE;//0x791;
    m_attrList[6] =       NC_ATTR_COMP_XTD;
                m_valueList[6] =    NC_MASK_XTD_DONTCARE;
    m_attrList[7] =       NC_ATTR_MASK_XTD;
                m_valueList[7] =    NC_MASK_XTD_DONTCARE;
    - opening it as follows:
                iStatus = ncConfig("CAN0", 8, m_attrList, m_valueList);
                iStatus = ncOpenObject("CAN0", objRXHandle);
    - I 've configured it with ncCreateNotification(objRXHandle,...), so on any received frame a callback is invoked.
    - no remote frames are used, since the target doesn't support them.
    - similarly I've defined the transmitting Object, but not opened it,
    because I do the transmitting via CANObjects (one per ArbID)
    - frames are only received after a command is written to the target
    (calling ncWrite(...)) within a manufcturer specific frame for a
    CANObject
    - up to now all fine
    - now I want a filter mechanism wich allows me to define a list of ArbIDs that must not be processed
    - my intention was to define the attribute and value of the receiving CAN Network Interface Object (as mentioned above):
    (...please continue on part 2)

    for answer see part 2
    DirkW
    Message Edited by DirkW on 01-10-2006 04:01 PM

  • Can I use a PCI-DIO-96 with HP Vee 5.0

    I'm trying to move an HP Vee 5.0 automated test program to a newer-faster-better computer and in to LabVIEW. But for a short time I need to be able to run both programs, to keep up with production during development and to prove the LabVIEW work the same or better. Can I communicate with the PCI-DOI-96 card from HP Vee? If so how?
    I have no manuals for the Vee 5.0 and was unsuccessful in searching both websites.

    If VEE has the ability to call a dll, then you should be able to use either traditional DAQ or DAQmx and communicate to the card. You might want to try the VEE Users Group as I doubt if you'll find many VEE programmers here in the LabVIEW forum.

  • Can I use the pci-6259 card with SCXI?

    I need to know if the new M style daq cards will still work with the SCXI devices. If so, is there any additional hardware ie. cable adapters that I need?

    Craig,
    M-Series devices should work just fine with SCXI. You will need a new cable, as the connectors on M-Series devices are different from those on E-Series devices. I believe the following cable should work just fine for your application: SHC68-68-EP.
    Dan

  • How can I send data from multiple range with VBA API ?

    hello everyone,
    i have one worksheet , multiple range. With addin , we can specified the range to retrieve or submit.
    In smart view  for retreive, I have the API retrieverange so  I can do the same. But for submitting data, I only have the API "HypSubmitData" and it doesn't take any paramater like a rangebut only the sheet !
    So how do you manager to do it ? one worksheet per range ?
    thanks for answers

    11.1.2.5.400 added the capability to perform range submission, however I doubt that the vba is not updated with the function. So you might have to wait for a while, or you can create a code which copied the selected cells to a hidden worksheet and perform submit from that sheet. Keep in mind that when the use make the selection, you'll have to copy the pov too.
    Regards
    Celvin Kattookaran

  • Can't remove a user defined field with DI API.

    Hi,
    I'm using the code below to remove a user field.  However, the first time I run it, I get the message that:
    "Ref count for this object is higher then 0"
    The second time I run it, I get the message that:
    "No matching records found (ODBC -2028)"
    As you can see, I am killing the UserFieldsMD object.  In fact, when the function is entered, the object is nothing but later instantiated with oCompany.
    The result in both cases is that the field doesn't get removed.  What am I missing?  Any ideas?
    Thanks,
    Mike
        Public Function RemoveUserField(ByVal FieldName As String, ByVal TableName As String, ByRef ErrMsg As String) As Boolean
            Dim Result As Boolean = False
            Dim Err As Integer
            Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD
            Try
                If Not FieldExists(TableName, FieldName) Then
                    Result = True
                Else
                    oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
                    With oUserFieldsMD
                        .TableName = TableName
                        .Name = FieldName
                        Err = .Remove
                        If Err Then
                            oUtilCompany.GetLastError(Err, ErrMsg)
                            If ErrMsg = "No matching records found (ODBC -2028)" Then
                                Result = True
                            Else
                                ErrMsg = "Was not able to remove field " & FieldName & " from table " & TableName & " programmatically." & vbCrLf & _
                                         "Please remove it manually using the Tools menu."
                            End If
                        Else
                            Result = True
                        End If
                    End With
                End If
            Catch ex As Exception
                Throw ex
            Finally
                KillObject(oUserFieldsMD)
            End Try
            Return Result
        End Function
        Public Sub KillObject(ByRef Obj As Object)
            If Not Obj Is Nothing Then ObjectRelease(Obj)
        End Sub
        Private Sub ObjectRelease(ByRef Obj As Object)
            'This routine releases objects that were acquired with oCompany.GetBusinessObject().
            System.Runtime.InteropServices.Marshal.ReleaseComObject(Obj)
            Obj = Nothing
            GC.Collect()
        End Sub

    Hi Mike,
    The issue with your code is that you are not calling the GetByKey method of the field object. Until you do this the FieldID property is 0 so when the Remove method is called it will not try and remove the correct UDF (if you run SQL profiler then you'll see that SBO is looking for the UDF based on the table and fieldID values).
    Something like the following works for me:
    private void DeleteUDF(string sTableID, string sFieldName)
        SAPbobsCOM.UserFieldsMD sboField = (SAPbobsCOM.UserFieldsMD)_sboCompany.GetBusinessObject(BoObjectTypes.oUserFields);
        try
            int iFieldID = GetFieldID(sTableID, sFieldName);
            if(sboField.GetByKey(sTableID, iFieldID))
                if (sboField.Remove() != 0)_sboApp.SetStatusBarMessage("Error removing UDF: " + _sboCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Short, true);
        finally
            System.Runtime.InteropServices.Marshal.ReleaseComObject(sboField);
            sboField = null;
            GC.Collect();
    private int GetFieldID(string sTableID, string sAliasID)
        int iRetVal = 0;
        SAPbobsCOM.Recordset sboRec = (SAPbobsCOM.Recordset)_sboCompany.GetBusinessObject(BoObjectTypes.BoRecordset);
        try
            sboRec.DoQuery("select FieldID from CUFD where TableID = '" + sTableID + "' and AliasID = '" + sAliasID + "'");
            if (!sboRec.EoF) iRetVal = Convert.ToInt32(sboRec.Fields.Item("FieldID").Value.ToString());
        finally
            System.Runtime.InteropServices.Marshal.ReleaseComObject(sboRec);
            sboRec = null;
            GC.Collect();
        return iRetVal;
    Note that the parameter sAliasID is the field name without the U_ prefix.
    Kind Regards,
    Owen

  • How can I use the latest Berkeley DB with SQL API in PHP app?

    Hi,
    I'm a PHP developer and I already use Berkeley DB in my applications using the [DBA Functions|http://www.php.net/manual/en/ref.dba.php] . I'm very interested in the latest Berkeley DB release. How can I write a PHP program that uses the SQL API of the latest Berkeley DB release?

    Hi Kurt,
    I'm not a PHP expert (far from it), but the simplest way to get started with the Berkeley DB SQL interface is to run Berkeley DB's <tt>configure</tt> script with the <tt>--enable-sql_compat</tt> flag.  This will create a library called <tt>libsqlite3.so</tt> that you can use as a drop-in replacement for SQLite at the API level.  Database files still need to be converted with a SQLite <tt>.dump</tt> followed by a <tt>.read</tt> with the <tt>dbsql</tt> tool.
    This should then allow the existing PHP driver and application code to switch over to Berkeley DB without any code changes by setting <tt>LD_LIBRARY_PATH</tt> to find the Berkeley DB version of <tt>libsqlite3.so</tt> ahead of SQLite. Note that any other code that relies on SQLite will also run against Berkeley DB with this configuration, which can cause problems if the system libraries use SQLite (for example, on Mac OS X). For that reason, a better long term solution would be for the PHP SQLite driver to have a mode where it loads <tt>libdbsql.so</tt> rather than <tt>sqlite3.so</tt>.
    I hope this helps, please let us know how you go because I'm sure lots of other PHP developers will be interested in the answer.
    Regards,
    Michael Cahill, Oracle Berkeley DB.

  • Need PCI-CAN/2 Series 1 card

    Anyone know where I can find an obsolete PCI-CAN/2 Series 1 card?  I need one that will run with the NI-CAN v1.5 driver. 

    Hi Russ,
    You can still get the NI Series 1 CAN cards from National Instruments.  We still recommend using Series 2 now that Series 1 is obsolete, but we do realize that some customers still use old versions of the driver.  Please call 1-866-275-6964 and reference request number 966567 for details on the Series 1 card.  I will try to get some details sent to you as well.
    If you have any questions or trouble getting into contact with anybody, let me know.
    Have a great day!
    Chris R.
    Applications Engineer
    National Instruments

  • Pci can drivers fail to install for ni-can 2.3.3

    after upgrading to labview 8.2, i realized that i needed to upgrade my
    version of ni-can in order to access my pci can interface.  the
    pci can card had been working fine with labview 8.0 and ni can 2.3.2 up
    to this point.  i left the card in the machine, downloaded ni can
    2.3.3, and ran the installer.  however, when i rebooted and the
    "found new hardware" wizard launched, it was unable to locate the
    driver files.  after selecting to let the system locate driver
    files automatically, i recieved the error message:
    there was a problem installing this hardware
    an error occurred during the installation of the device
    the system cannot find the file specified
    i then attempted uninstalling ni can, removing the card, reinstalling
    the software, and THEN reinstalling the card; however this produced the
    same results.  any ideas on what i need to do to get drivers
    installed that will work with labview 8.2?
    thanks.
    Ben.

    Hi
    First of all you need to act with administrator rights.
    It seems something went wrong during driver upgrade. Right now the situation is that you have the 2.3.2 driver installed and the device is in the computer too?
    If not uninstall 2.3.3 and reinstall 2.3.2 and the CAN device and reboot.
    Now remove the CAN device first and after booting again uninstall the driver and delete the NI CAN folder if still available.This will hopefully remove all hardware related information from the registry.
    Then boot again and install the 2.3.3 driver, then boot again and install the device.
    Hope that helps.
    DirkW

  • The second frame lost in CAN communication when use NI PCI-CAN/XS2 card

    I got a trouble on CAN communication recently.
     I need to commmunicate a Cluster with CAN BUS,the baud rate is 500kBPS,the CAN card is NI PCI-CAN/XS2. The operating system is Windows XP.
    normally,the PC send a command to Cluster,then read back a frame of data from the Cluster,but for some commands,the Cluster will return two frames of data,and the programe on PC cannot receive the Seconds frame,it lost.
    I searched the forum,most of the reslut is the error about CAN BUS overflow,which make the CAN frame lost,but there is not any error report on my programe,and the baud rate is no that fast,I also use another port of NI PCI- CAN/XS2 to monitor the CAN bus,the second data frame never appear,when I replace NI CAN card with Vector CanCaseXL(CAN card) ,and call CanCaseXL's DLL in labVIEW,it can get the second CAN frame,the monitor of Vector CanCaseXL can get the second data frame too.
    so,is there some software/hardware configuration need to be done to get the second data frame?
    the attached pictures are NI-CAN/Vector CAN monitor and CAN init/write&read in my programe.
    Any reply is appreciate!!! thanks
    帖子被iwanttofly014在 12-12-2009 07:41 PM
    时编辑过了
    帖子被iwanttofly014在 12-12-2009 07:43 PM
    时编辑过了
    Flying...
    www.vihome.com.cn 虚拟仪器家园
    Solved!
    Go to Solution.
    Attachments:
    NI CAN monitor.jpg ‏165 KB
    Vector CAN monitor.jpg ‏58 KB
    CAN init.jpg ‏80 KB

    Thanks your code.
    I try the code you posted, It still no work, I found you has improved the "Get data.vi",It works better,but the second frame still no shown.
    I used the  NI CAN monitor in MAX to monitor the CAN bus,there is no second frame shown in the monitor,See attach pictures.but It shown in the Vector CAN monitor and the code call the Vector DLL.
    Have a great day.
    帖子被iwanttofly014在 12-16-2009 08:02 PM
    时编辑过了
    Flying...
    www.vihome.com.cn 虚拟仪器家园
    Attachments:
    LabVIEW VS Monitor(Vector CAN).JPG ‏70 KB
    LabVIEW VS Monitor(NI CAN).JPG ‏40 KB

  • How do I get my PCI-CAN card to work in my Dell computer?

    I am trying to get a PCI-CAN card working in a Dell GX110 computer. The computer quits right after the initial Dell spalsh screen goes away. After that point, I only get a flashing cursor in the top left corner. NI support suggested a bios upgrade, but the computer is already at the latest bios rev. When I remove the card, the computer boots fine. What do I try next?
    Lars

    The problem may be related to a specific chip ( MITE) on the PCI CAN card. Please call us at 512-795-8248 with the part no and the serial of the PCI CAN card, so that we can verify whether the CAN card may have a hardware problem and have you send the card back to us for repair or to get a replacement.

  • Visual basic 6.0 with PCI-CAN series 2

    Hi all,
    I'm a newbie in CANOPEN, hopefully I can get some guidance to start off the application development.
    Basically I wished to develope a simple VB program to move/stop the motor at different speed and to monitor the position.
    There is only 1 master which is the PCI NI-CAN and 1 device. The device which is the servo amplifier is Kollmorgen S600.
    http://www.maccon.de/fileadmin/FTPROOT/s400600can_e.pdf
    During the amplifier boot up, I'm able to receive 0x81h 00 00 00 00 00 00 00 00 at both the MAX's bus monitor and the NI's Frame API, thus ensuring that the baud and hardwares are correct.
    I wished to perform a "SDO-READ" and "SDO-WRITE" using the Frame API as followed :
    http://img.photobucket.com/albums/v208/rainman1978/sdoexample.jpg
    The Frame API VB software example given has this abiturary ID, data length, remote frame (YES/NO) and extended frame (YES/NO). In the write procedure it has :
    Transmit.Data(0)=&H0
    Transmit.Data(1)=&H1
    Transmit.Data(2)=&H2
    Transmit.Data(3)=&H3
    Transmit.Data(4)=&H4
    Transmit.Data(5)=&H5
    Transmit.Data(6)=&H6
    Transmit.Data(7)=&H7
    etc etc followed by its standard ncwrite procedure.
    I made change to the transmit datas.
    Transmit.Data(0)=&H40
    Transmit.Data(1)=&H41
    Transmit.Data(2)=&H60
    Transmit.Data(3)=&H0
    Transmit.Data(4)=&H40
    Transmit.Data(5)=&H0
    Transmit.Data(6)=&H0
    Transmit.Data(7)=&H0
    There isn't any response back from  the amplifier and I bet the frame format must be wrong.
    This is what I observed from the NI SPY when I send out the data. (when VB set to ID 5 and data length set as 8)
    05 00 00 00 00 08 00 00 41 60 00 40 00 00 00 (something likethis, which I couldn't relate at all)
    Thanks. Hope I can get a wake up call to this complicated bus protocol.
    Regards,
    Rainman
    Attachments:
    Transmit Receive same Port.zip ‏5 KB

    Got it!!!
    To all that will try to use the VB6 application:
    In the LabView examples the COB ID default is in hex, and in the VB examples the COB ID default is dec !!! The GUI of the 2 examples (VB & LabView) is exactly the same but it will not work unless you use the correct COB-ID.
    So, for example, if you want to use the labview example and you want to enter the ID 601: you Enter 601 in the ID text box.
    However, if you want to use the VB6 example with the same ID you need to insert 1537 (=601 hex!!)
    I hope that with this post I will save some people the 3 days that it took me to find this!
    Shilo

  • Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??

    Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??
    How Do I generate those signals?

    Hello;
    You certainly can do that. The way to go about that is to use one of the Analog Output channels your board have available.
    If you are using Labview to program the board, you can find good examples at Search Examples->I/O Interfaces->Data Acquisition->Analog Output->Multiple Point (buffered) Analog Output.
    If you are using other Software language to program the board, you can fing examples at C:\Program Files\National Instruments\NI-DAQ\example\VisualC\AO.
    Hope this helps.
    Filipe

  • Are there any PCIE CAN Cards Compatible with Labview RT?

    Hi,
    I am looking for a mini PCIE CAN card or PCIE 1X CAN card that will run under Labview RT.  Are any of you using a PCIEC AN card with Labview RT?
    Thanks,
    Phillip

    Hello Phillip,
    I do not believe that we have any PCIe CAN cards. Here is a link to the PCI CAN cards that will work on LabVIEW Real Time(http://sine.ni.com/np/app/main/p/bot/no/ap/icomm/lang/en/pg/1/sn/n24CI,n21:17,n17:icomm,n19:Real%20T...). Please let me know if you have anymore questions. Have a great day!
    Best Regards,
    Adam G 
    National Instruments
    Applications Engineer

  • Will PCI-CAN card work with only 2 wires?

    If I'm using my PCI-CAN card configured for internal power, do I need to connect anything other than CAN-L & CAN-H to my CAN network? I'm doing this right now and am able to correctly receive packets thru the card. However, it appears that my transmitted packets are not being seen by the other nodes. I'll know more when my CANalyzer arrives, but I was wondering if my cabling is OK as-is.

    I currently have a connection set up with only CAN-L and CAN-H wires connected. I am able to transmit and receive with no problems at 500kbs, so it should work as long as the lines are properly terminated. (120ohm resistor bridging the wires at both ends)

Maybe you are looking for