Get a precise timing in a C++ shared library in VxWorks

Hello world

I am developing a shared library for VxWorks for my compactRio access a «no massive strorage» usb device

I work with gcc (see develop shared libraries for the cRIO-901 x and other targets of VxWorks for more details).

The usb part works fine, but I now have to obtain a precise timing in one c++ shared library functions. I tried the functions clockLib (e.g. clock_gettime () - see page 8 of the http://www-ad.fnal.gov/controls/micro_p/manuals/vxworks_application_api_reference_6.6.pdf for more details), but they seem to have a resolution of 1 ms, which is not enough for me.

There is a clock source faster on the cRio (at least 1 Mhz, one used for timed loops) but I do not know if such a source could be used in a shared library. If so, anyone knows what are the functions of call?

Thank you very much

Martin

OK, I thought about it.  These functions are exported as C functions, so you should use extern 'C' instead of extern just by itself, as I did originally.  Once I did, I was able to compile the following code in its own. File AND it works fine:

#include
extern 'C' unsigned long niTimestamp32();

extern 'C' Sub TimeTest()
{
unsigned long ts = niTimestamp32();
printf ("niTimestamp32 () = 0x%08X\n", ts ");
}

Good luck and let me know if you have any problems and more.

Tags: NI Hardware

Similar Questions

  • Warning message about the shared library file

    I got this warning message when I try to open the sample xml configuration.

    C:\Program NIUninstaller Instruments\LabVIEW reference (Impl) 8.6\vi.lib\xml\Close .vi (NI_XML.lvlib: Close Reference (Impl) .vi)
    -The shared library should happen to "": \addons\internet\dom\DOMUserDefRef.dll "has been charged with"DOMUserDefRef.dll"."
    C:\Program NIUninstaller Instruments\LabVIEW .vi reference (NdList) 8.6\vi.lib\xml\Close (NI_XML.lvlib: Close Reference (NdList) .vi)
    -The shared library should happen to "": \addons\internet\dom\DOMUserDefRef.dll "has been charged with"DOMUserDefRef.dll"."
    C:\Program NIUninstaller Instruments\LabVIEW .vi reference (NNMap) 8.6\vi.lib\xml\Close (NI_XML.lvlib: Close Reference (NNMap) .vi)
    -The shared library should happen to "": \addons\internet\dom\DOMUserDefRef.dll "has been charged with"DOMUserDefRef.dll"."
    C:\Program NIUninstaller Instruments\LabVIEW reference (node) 8.6\vi.lib\xml\Close .vi (NI_XML.lvlib: Close Reference (Node) .vi)
    -The shared library should happen to "": \addons\internet\dom\DOMUserDefRef.dll "has been charged with"DOMUserDefRef.dll"."
    C:\Program NIUninstaller Instruments\LabVIEW 8.6\vi.lib\xml\Get Child.vi first non-text (NI_XML.lvlib:Get first non-text Child.vi)
    -The shared library should happen to "": \addons\internet\dom\DOMUserDefRef.dll "has been charged with"DOMUserDefRef.dll"."
    C:\Program NIUninstaller Instruments\LabVIEW 8.6\vi.lib\xml\Get Sibling.vi non-text next (NI_XML.lvlib:Get next non-text Sibling.vi)
    -The shared library should happen to "": \addons\internet\dom\DOMUserDefRef.dll "has been charged with"DOMUserDefRef.dll"."
    C:\Program NIUninstaller Instruments\LabVIEW 8.6\vi.lib\xml\Get text Content.vi (NI_XML.lvlib:Get text Content.vi node) node
    -The shared library should happen to "": \addons\internet\dom\DOMUserDefRef.dll "has been charged with"DOMUserDefRef.dll"."
    C:\Program NIUninstaller Instruments\LabVIEW 8.6\vi.lib\xml\Load XML File.vi (NI_XML.lvlib:Load XML File.vi)
    -The shared library should happen to "": \addons\internet\dom\DOMUserDefRef.dll "has been charged with"DOMUserDefRef.dll"."
    C:\Program NIUninstaller Instruments\LabVIEW 8.6\vi.lib\xml\New.vi (NI_XML.lvlib:New.vi)
    -The shared library should happen to "": \addons\internet\dom\DOMUserDefRef.dll "has been charged with"DOMUserDefRef.dll"."

    I've recently updated to 8.6 and I try to compile an executable, but b/c of this warning my executable is not running sends me weird errors. I took the code that calls the XML that is read, and it is fixed. How should I do? Thank you!

    I get this error message when I tried to run the .exe with the xml configuration reader.

    "The application failed to start because xerces - c_2_7.dll was not found. Reinstalling the application may fix this problem. »

  • Dim in Shared Library is not CustomXTopMember or EnableCustomXAggregation properties

    We are reclassification of 11.1.2.1 to 11.1.2.3.500. We use the shared library for our HFM application. In 11.1.2.3.500, there is no options for EnableCustomXTopMember or EnableCustomXAggregation (where X is the number of the custom dimension IE custom 1, custom 2, 3 Custom, Custom 4).

    In the dimension of local account in the new version, it has these properties.

    In the dimension shared account in the old version, it has these properties.

    In the dimension shared account in the new version, it doesn't have these properties.

    In the new version, I had to copy the application account dimension to get the Dimension Associations to create the shared library, but even with the Dimension Associations created, we still do not see the properties of the shared library.

    We have our custom in the shared library setup of dimensions.

    We have tried to import via LCM and import profiles, but LCM gives us errors and warnings that it cannot associate the property with the dimension:

    "There was an error during the processing of the dimension for the base dimension 'Account' association, dimension target"Custom1 "; Please make sure that the dimension of the target exists or is included in the section of the dimension of the source of imports.  Member of this association properties will not be processed. »

    Any ideas on why the properties not exist in the shared library and will not import or copy in the shared library in 11.1.2.3.500?

    Here are a few screenshots:

    ScreenHunter_08 Feb. 19 16.48.gif

    ScreenHunter_09 Feb. 19 16.48.gif

    ScreenHunter_10 Feb. 19 16.49.gif

    ScreenHunter_11 Feb. 19 16.49.gif

    Thank you

    Hi Steve,.

    I met the same problem too.

    To work around the problem, start creating a dummy application with dimensions shared new version. This will create associations. After that, you can remove the application.

    See you soon,.

    Thanos

  • I have trouble getting my videos and pictures OF my shared albums. Once I shared them, I can't copy or save on my phone.

    I have trouble getting my videos and pictures OF my shared albums. Once I shared them, I can't copy or save on my phone.

    After you have shared photos and videos, they are always on your phone, unless you delete them.

  • How do you get a @PARENTVAL in another hierarchy of shared members?

    Easy I know, but I couldn't find it.   I am looking for a way to get a @PARENTVAL in another hierarchy of shared members.  If I'm correct or check if the CURRMBR is a member of the alternative hierarchy, ancestor references will only be in this area?

    Yes, it is not the largest element of documentation ever.

    This is perhaps a more useful example.  In Sample.Basic, I created two members dynamic calc:

    "Sales of parent" formula: =@PARENTVAL ("product", "Sales");

    "Power Parent Sales" formula: =@SPARENTVAL ("Diet", "Sales");

    Results:

    'Régime' is another hierarchy.  Look at the values for the products below.  You can see that with @PARENTVAL, I always get the primary parent of hierarchy, but with @SPARENTVAL I choose the parent sales in a specified hierarchy.  Interesting to note that if the Member is not at all a part of the hierarchy 'Diet' @SPARENTVAL just gets the value of the hierarchy of the main.  It is perhaps which means that the ILO "closest to the basis of events '...  I expect a little #Missing if I ask @SPARENTVAL ("Diet", "Sales") for a product that does not appear in the hierarchy "Diet", but this isn't how it works, of course.

  • Unable to load the shared library nilvce.*

    When you try to deploy a Labview 2009 real-time application, I get the message:

    Deployment XDNodeRunTimeDep.lvlib:loadnilvce.viXDNodeRunTimeDep.lvlib:loadnilvce.vi loaded with errors on the target and was closed.

    LabVIEW: Unable to load the shared library nilvce. *: niLVCtrlEngineReserveProc:C on the target RT device.
    Completed with errors of deployment

    I reformatted the CRIO-9073 and reinstalled the software, but this did not help.

    Any ideas on how to solve this problem?

    I was able to solve this problem by changing the settings in a timed loop Structure.

    The Source Type has been set to "synchronize in the scan engine.  This change to the problem solved 1 kHz clock source.

    This vi was initially written for the interface of the scan engine and reused on another project that uses the FPGA interface.

  • tables as input for the shared library function

    I played with the call of LV VI using matlab.

    So I built a simple VI which returns an integer as input and multiply it by 10, I then put in a shared library and named it MATLAB - well.

    Now, I tried to do the same thing with a table - I want to send a picture to the VI and multiplied it by 10, but when I build the .h file, it seems that the function expects get table of entry AND exit of table as inputs.

    so, how I can build a shared library VI who gets an array (of a constant size if this is important) and multiply it by 10?

    Thank you!

    A function in a DLL can only return a scalar value, not a table, no matter what languages are used. To return an array, instead calling it allocates the array pass a reference to the DLL and then after the function called the referenced table table contains the new data. This is why there are two parameters - the input array (actually a pointer to it) and a pointer (reference) to the output array. You must change your code in MATLAB, there is nothing you can do about it in LabVIEW. EDIT: Also note that it allows to re-use of the input as an output table, optionally passing a reference only to the table of entry and then by changing that. You can do it in LabVIEW by configuring the setting table as input and output.

  • Unable to load the shared library LVASPT_WA.*

    Hello

    I have a hope that easy to fix the error: I want to use the function "WA Detrend' to the signal processing tool advanced in a real-time application running on a cRio 9030. When I try to run the VI I get the following error:

    ...

    Deployment NI_AdvSigProcWA.lvlib:WA decimation Filter.vi

    NI_AdvSigProcWA.lvlib:WA decimation Filter.vi loaded with errors on the target and was closed.
    LabVIEW: Unable to load the shared library LVASPT_WA.*ptDecimationFilterH:C. make sure that the library is present on the target of RT. Either MAX allows you to install software from OR or FTP to transfer custom RT target libraries.

    ...

    I reinstalled signals Advanced processing toolkit and linked things 'add new software' MAX, but the error persists.

    A picture of what the system looks like to the MAX is attached.

    Also, I Fund this post:

    http://forums.NI.com/T5/LabVIEW/problem-error-deploying-item-on-RT/m-p/3201345/highlight/true#M92822...

    could someone tell me what he means by "Please check the installation of the custom software all mode '?

    Can you telll me what I am doing wrong?

    Thank you very much in advance!

    I ran your situation in R & D, and the problem seems to be as a result of Advanced Signal Processing Toolkit is not not compatible on the x 64 under Linux RT OS in the 9030.  The product page could be clearer on this gap.  I am currently a web application to get this fixed!

    Best,

    David

  • Call to a shared library a VI on a target NI Linux RT (cRIO 9068)

    Hi, I wrote a very small shared library (.so) with Eclipse (toolchain 2014), which essentially serves as a wrapper for more complex, but I am having problems with the call go to in LabVIEW RT on a target Linux RT - specifically, the cRIO 9068. First: the library was copied in/usr/lib and ldconfig has been correctly implemented. More important yet, I have also written a C program (using Eclipse as well) that calls the single function currently implemented in the shared library: this works perfectly, both in Eclipse and you connecting directly on the cRIO with a Putty terminal. So I guess the shared library itself is ok and can be called from code/external programs. Now, dating back to LabVIEW (2014 here btw). Here's where things get difficult, I guess. Initially, I had the symptoms listed here--> http://forums.ni.com/t5/LabVIEW/How-to-create-a-c-shared-library-so-for-linux-real-time-for/td-p/302... who prevented me from actually run any code on the target of RT. Then I changed the call library function node: various tutorials suggest to put name_of_library.* in the path text box or the name of library, but unfortunately it doesn't seem to work, so I had to put the name and the extension too. But it still produces the error below ("the name of the function is not found" etc.) So I check the box 'specify path on diagram' and add/usr/lib as a parameter to the node library function call: now the VI can work and is actually transferred to the target of the RT... but the cluster of output error returns error 7, which is a kind of "File not found" error. However, I believe that this error message is misleading: indeed, if I try to debug remotely this library shared under Eclipse, I am actually able to pause it. and when I press the Pause button on the debugger, the goal of RT VI pauses, then continues as soon as I press the Resume button, I'm stuck... I tried searching forums and Google as well, but I have not yet found a solution. Any ideas on what's going on? Moreover, I can add more details if needed.

    Problem solved, it was a bad configuration of the node library function call which prevented the actual library (.so) to be called.

  • myRIO can't find my shared library .so

    Hi all

    I have developed a shared .so library to run on a device myRIO. I moved my shared library for the path/usr/lib of the myRIO. When I run the .VI I get this error:

    Deployment RT.viRT.vi loaded with errors on the target and was closed.
    LabVIEW: Unable to load the shared library libsolve.so:solve:C. make sure that the library is present on the target of RT. Either MAX allows you to install software from OR or FTP to transfer custom RT target libraries.

    Any idea? I reinstalled the software on the myRIO but I still have this error (I comproved if the shared library is on the right track with filezilla and Eclipse).

    Thanks in advance

    Well lets try a little more detailed explanation:

    Firstly the soname parameter is a parameter of time to compile/link in the project of the shared library. I don't have a computer with a handy Eclipse installation but it's somewhere in the additional indicators in probably the settings of the linker where to a shared library named libfoo.so.1.3.6 add something like:

    -Wl,-soname,libfoo.so.1
    

    You would then copy the shared library resulting on the linux system.

    cp libfoo.* /usr/local/lib
    

    After that, you must do a few extra things:

    (1) change the access rights for the file, otherwise ldconfig may not recognize it as an executable file and simply ignore it:

  • Error during the generation of shared library for OSX

    Hello

    I am trying to build a shared library (.framework) using LabVIEW 2011 as Mac.

    My Version of OSX is 10.7.3.

    When I run the build process, TI allways give up showing the error message:

    There is 1 error in DLL - C compile Source File.vi Possible reason (s): you must have the Apple Developer tools installed to build a shared library. Install the Apple Developer tools and attempts to reconstruct the shared library.

    I don't know what developer tool is missing or if there is another problem with my environment.

    Thank you

    Gschwert

    Hi Gschwert,

    in the meantime, I received a response from our developers in Austin.

    Developer Tools Apple which refers to should be X-Code.

    They work with X-Code Version 3.0 and have no problem. They will try to work with your versions (4.2 and 4.3) too and take a look, if there is something special to look for.

    Have you tried using X-Code 3.0? Then you get the same problems?

    Good day

  • Error message "unable to load the shared library.

    I try to get my programs for school to work, and I get these error message whenever I try to run anything. The last line of the State of deployment is as follows:

    Deployment time get NLVSim and isAcceptedStep.vi IsAcceptedStep.vi and NILVSim get busy with errors on the target and has been closed.

    LabVIEW: Unable to load the shared library NILVSim.*: SIM_GetTimeAndIsAccepted:C. make sure the library is present on the target of RT. Either MAX allows you to install software from OR or FTP to transfer custom RT target libraries.

    I tried everything I can think of to fix this. I checked NEITHER Max and I'm all for date on the software. I reinstalled LabVIEW twice, and I reset my myRIO. My classmates do not experience problems with getting theres to work. I start to lose hope and hope someone might know what the question. Thank you for your help.

    WubaDee,

    NILVSim is part of the LV Control Design and Simulation Module. This one is correctly installed on your Windows development system and you installed it on your myRIO?

    Norbert

  • Error during import Shared Library: library specified for this node was not found or could not be loaded

    Hello

    I use LV-2009 for Linux. I am creating a Wrapper Vi. I have a simple addition of C++ function that I created a .h header file and a shared .so library. After you import the shared library, I get an error report, I joined here (Report.doc).

    When I right click on the Subvi and click on configure to mention the .so library path, I see a window saying "file not found. The file may have been moved or delete", even though I have this library in the path that I've specified.

    I've attached a screenshot of the error I get. Please suggest what can be done.

    Thank you.

    Kind regards

    -H.



  • WMP Shared Library work

    I searched for a few days now and I can't find an answer to a question I have about Windows Media Player and work for music in a shared library, so I will try to explain here in the hope that someone might be able to help.

    There are two involved PC - one, machine 'A' is currently running Windows XP Pro and currently hosts all of my photos, video, music, etc. Machine 'B' runs Windows Vista Edition full and is generally used to hear or see the media of the machine.

    After a few questions of works of art in general I decied to try to pin down exactly what was going on.

    I erased the data files WMP on both machines and made sure there is no folders added to automatic records / default for both the libraries began as empty (initially find only 'local' music that comes with Windows itself).  Also, two WMP is set to not download any information from the internet media. Fine so far.

    On computer A, I created a test folder and put it in a folder with the tracks of an album and another folder with a few individual pieces of music. I also created an easily identifiable artwork for the album and for some of the individual tracks and made sure this work has been the unique work stored in the relevant music files ID3 tags.  I have also made sure there is no WMP work files in this folder to test (so not of Folder.jpg, AlbumArtSmall.jpg or AlbumArt_ {GUID} .jpg).

    I started up WMP again on computer A, and added this test folder to the library.  WMP correctly analysed and displayed a few items, he created the usual mess of it is work of course, files but it used * my * work from the ID3 tags.  Once again, great so far.  I put it to share its library.

    On computer B, I asked "look for other media share" and he immediately found the library shared by a machine.  However, if I look at the items in the shared library, I see the content of my file test, but with different illustrations - the art of actual coverage of the relevant albums.

    My first assumption was that, even if the machine B has been fixed to not download anything on the internet recovering always the album artwork for the items in the shared library.  To test this, I have blocked access to internet on my router and again allowed out WMP files on computer B.  When he again accesses the library shared on computer A, it immediately displays the work of 'bad' again - but he could not have received this Web this time, if he get all this?

    I assume that the work is cached somewhere and picked up images of a previous connection to my comprehensive library on the computer B the machine, but I don't want to.  I want to use the work in the files of current music, like WMP on machine made.

    I'm a bit puzzled, because I don't even know if machine B becomes the ('bad') work from somewhere in itself, or if it comes from the machine.  I can't imagine that it's from a machine - why WMP on this machine would use the 'proper' work itself but then give another machine a copy cached in the work of 'bad '.  So presumably, these images come from somewhere on computer B, or is there another explanation?

    Sorry that took so long to explain, I can't believe Microsoft had done this so complicated.

    Anyone can shed some light on this?

    Thank you very much

    Foam

    Update:

    After a better looking PC in question, I could have answered my own question, I thought I would add here in case this is useful to someone else...

    It seems that WMP (and Media Center) on the Vista machine at least keep several copies of the updated album art cache in multiple places and using different format of file names - that's why the failure of my first attempt to locate them.

    So after having erased the following folders:

    %LocalAppData%/Microsoft/eHome/art cache

    Cache drive/Art %LocalAppData%/Microsoft/Media/LocalMLS

    %LocalAppData%/Microsoft/Media Player/MCH/Albums

    Both Windows Media Player and Media Center on my Vista machines, reloaded the correct album artwork - I don't know if they use the ID3 tags on music files or work remote library files, but as they were all based on my work now, I don't actually mind.

    Foam

  • Shared library with 10.2 NDK

    I have some classes of Qt/stunts, I'm working on that I want to incorporate a shared library.

    Originally, I was able to follow http://supportforums.blackberry.com/t5/Native-Development-Knowledge/How-to-create-a-shared-or-static... to create the library, but in the latest releases of the NDK, this does not work.

    Method B of this article does not work for Qt\Cascades classes since moc is never called, even if the used compiler is QCC. If I want to do a project of Qt\Cascades, I can only do an application project. If I tape everything that is not related to the library (assets, translations, master, etc.). I got some errors.

    Is first with the missing translation files. This can be corrected by changing the make files and the file *.pri (although I guess it will be readded by the NDK...)

    The second and more important question, is that even when I add "TEMPLATE = lib" in the file * .pro, which appears to have ignored, I get an error which is described as 'missing main function', which tells me that it is still trying to apply as opposed to a *. so.

    How can I produce a shared Qt\Cascades within the current NDK 10.2 library?

    Discover my stunts/Qt library template https://github.com/blackberry/Cascades-Community-Samples/tree/master/Cascades-Library-Template.

    It should have everything you need.

Maybe you are looking for