Jump to content

dadreamer

Members
  • Posts

    355
  • Joined

  • Last visited

  • Days Won

    36

Posts posted by dadreamer

  1. 3 hours ago, alvise said:

    When I make a change like below, it only saves one file, shouldn't it save a new file for each event iteration? Why does it only save one file? Is the method I'm using correct?

    - The "1" case is for NET_DVR_SYSHEAD capture, but you assign NET_DVR_STREAMDATA name inside it; the "2" case is for NET_DVR_STREAMDATA capture.

    - You have unwired tunnel for blue wire in some frames of the Event Structure. Don't you see that small rect is not painted completely?..

    49 minutes ago, alvise said:

    Are you saying it's unnecessary to send any value to "dwDataType" like in the photo?

    It's senseless! You can input any values in that cluster constant and this changes literally nothing. This constant is only to define the User Event data type and that's all.

    51 minutes ago, alvise said:

    I'm looking at this sample code as I don't have a solution at the moment. How can we use this sample code to achieve the desired result?

    So can you call the functions from the PlayM4 SDK now? You need to find a suitable function to decode the stream and receive a ready-to-use bitmap or pixels array. I don't know exactly which one is okay as I can't find the documentation (but I barely searched, to be honest, because was busy today).

    Ok, I found these:

    //get bmp or jpeg
    PLAYM4_API BOOL __stdcall PlayM4_GetBMP(LONG nPort,PBYTE pBitmap,DWORD nBufSize,DWORD* pBmpSize);
    PLAYM4_API BOOL __stdcall PlayM4_GetJPEG(LONG nPort,PBYTE pJpeg,DWORD nBufSize,DWORD* pJpegSize);

    Do you have them in your headers?

  2. 7 minutes ago, alvise said:

    Yes, I'm getting errors like the following.

    It's difficult for me to find the errors source from your screenshot.

    7 minutes ago, alvise said:

    With the method you suggested, it is necessary to stop and restart the VI for each new package.

    No. Just replace the filename string constant with your randomised filename and the frame will be recorded to a new file on each event.

  3. 10 hours ago, alvise said:

    -I'm looking at the example here. I think it is necessary to read the 'NET_DVR_SYSHEAD' package.

    Maybe. I've been browsing their samples too. Looks like they use a custom MPEG-4 decoder. In NET_DVR_SYSHEAD case they just initialize the decoder as this is the very first frame. But seems that the actual pBuffer contents of the system header aren't used in any way. Or I'm wrong? Later in NET_DVR_STREAMDATA case they obtain the packets and render them into a separate window using that MP4 decoder. Maybe it would be easier to use it instead of reinventing not only a wheel, but an entire car. Could you try to #include "plaympeg4.h" header to your code and recompile? Do you receive any errors?

    10 hours ago, alvise said:

    I took a few records as below and created the records with a normal button.

    Normal button is not suitable here due to the reasons I explained earlier. You could try to generate a random file name on each packet arrival (say, packet number or current date + time or something else), so the data gets recorded into a new file instead of being written to the same file.

  4. SetCbState returns nothing! Its return value is defined as void. That means that the function does not have a return value at all (in Pascal and Delphi such a function is called procedure). So after you set some return value for it in the CLFN settings, you keep getting some totally unrelated numbers, e.g. return values of some internal functions in LV core or whatever. It's useless to search for some correlations between that fictional return value and dwDataType. And even if there would be some connection (as after you change some constant and LabVIEW recompiles all and it affects the memory layout in some 'unusual' way), it's of no use absolutely.

    6 hours ago, alvise said:

    -I try as follows, but the size of the array does not remain constant, it constantly changes between 0 and 4350

    It seems to be more complicated then. Honestly I even don't have an idea how and where to start from. Maybe you could collect several (or more) files with different sizes and upload them?

  5. 13 hours ago, alvise said:

    I can only capture the ''NET_DVR_STREAM DATA'' packet.

    In some of your previous tests you showed that NET_DVR_SYSHEAD arrives first and is followed by a sequence of NET_DVR_STREAM_DATA packets. I can't say now, whether we really need NET_DVR_SYSHEAD to analyse NET_DVR_STREAM_DATA, but it would be useful to have both of them.

    13 hours ago, alvise said:

    I saved 2 different samples.

    There's something strange in those samples.

    2022-06-05_16-27-14.jpg.1ae30de000f074d8725873382daf6899.jpg

    20 bytes only? Really? Well, very good compression achieved! 🙂 Could you add Array Size node to your handle wire to check its actual size at runtime?

  6. My assumption is that if you already have MKL Runtime installed (I see that it is so), then your PATH environment variable should contain full path to the \bin\ directory of the MKL parent directory (as stated in mklvars_intel64.bat or mklvars.bat). But I have never compiled DLLs with MKL linking, so you better to ask on some C/C++ forums or stackoverflow or experiment with it on your own.

  7. 3 hours ago, alvise said:

    I think the problem arises when using "NET_DVR_SetRealDataCallBack" function. Using this 'NET_DVR_SetRealDataCallBack' function fixed the problem.

    You mean using NET_DVR_SetRealDataCallBack instead of NET_DVR_SetStandardDataCallBack?

    3 hours ago, alvise said:

    Data can now be read without any problems.

    So could you do this then? We can't go on without looking at the data as nobody except you has that hardware here. Of course, you may figure out the format of the data on your own, if you wish.

  8. 29 minutes ago, alvise said:

    The problem here has reoccurred, even though I have made no changes

    I suppose you did something in either your Visual Studio project settings or in your DLL code... This is odd. Check the library dependencies again. Check if you are on Release build. Clean up / remove the output build folders and rebuild everything from scratch.

    BTW NI recommends using Dependencies - An open-source modern Dependency Walker 😉

  9. @alvise Yes, you better to adapt your DLL code as written in order to see the error numbers according to the SDK and no more guess on coffee grounds. I see on your screenshots that "callback start return" is 0 (FALSE), but "callback stop return" is 1 (TRUE). As per the documents FALSE indicates some error and if it occurs when calling NET_DVR_SetStandardDataCallBack it would be good to know the reasons.

    By the way here's HCNetSDK Error Codes list online to easily correspond error numbers with their text messages.

  10. 3 hours ago, Youssef Menjour said:

    are there routines to integrate into my code in order to remove these objections?

    In fact your app requires the libraries on the very first level shown in Dependency Walker. The others are needed too, but they are being loaded by their "parent" DLLs, so you don't need to worry about them. Could you collapse that DLL list on the left of the DW, so we could see the first level libraries except sycl.dll and kernel32.dll? Don't look at those red warnings as they are about not finding some libraries, which likely are loaded during the runtime or have delayed loading or could even be absent in the system (as some .NET assemblies) and the app is able to run fine without them. So if only sycl is necessary, then you could either provide the path to it in your PATH environment variable or try to put it near your own DLL and check, whether LabVIEW loads it all without errors.

    • Like 1
  11. 7 hours ago, alvise said:

    - After pressing the "Run" button, I press the "Stream" button, the data can be read, then I press the "Stop" button and the data flow is stopped. If I press the "Start" button again without pressing the "Exit" button, the data will not be read. I press the stop button again.

    Press 'Start" -> press "Stream" -> the data is being read -> un-press "Stream" -> press "Stop" -> again press "Start" -> again press "Stream" -> the data is being NOT read... Is that your order of actions?

    By the way, do you know that InstallStandardCallback has return value?

    2022-06-03_10-00-39.jpg.008c692b25eb7c547c08ff679be7cb45.jpg

    You have set it to void in the CLFN settings, but it should be Numeric -> Signed 32-bit Integer. So let's check that value. Put two indicators on your FP from both InstallStandardCallback calls and watch which values they obtain in "good" and in "bad" case. According to the documentation for NET_DVR_SetStandardDataCallBack TRUE (1) means success, FALSE (0) means failure and NET_DVR_GetLastError should be called to find out the reason behind the error.

  12. 10 minutes ago, Youssef Menjour said:

    Regarding the release build, I haven't tried it because I didn't understand the difference and how to make it work. Could you be more explicit?

    Just switch to Release option on the MSVS toolbar. As to the differences, you may read about them e.g. here . To add to there, debug builds depend on the debug version of Visual Studio Runtime libraries, whereas release builds depend on common MSVCRT DLLs, that are very likely already installed in the system. Hence if you compile debug app or library and deploy it to machines without Visual Studio installed, it will ask you for the debug DLLs or even the whole Visual Studio to be installed. Release app/DLL on the other hand usually requires Visual C++ Redistributable Runtime only.

    • Like 1
  13. 1 hour ago, alvise said:

    Is there a problem here?

    Seems more or less ok. But better to place UninstallCallback CLFN in the "stop" frame as you install the callback in the "start" frame. I also assume you're passing NotARefnum as Adapt to Type -> Handles by Values with cdecl convention.

    Wait, I've just thought it would be good to have an organized dataflow in both "start" and "stop" frames. In "start" first do the event handling (registration etc.), then call Start.vi, then install the callback. In "stop" do in the opposite order. You may easily set the dataflow order with two ways: either with brown error wire or with Sequence Structure. There's a State Machine pattern as well, but I feel you're not ready to remake all the program right now.

  14. 15 minutes ago, alvise said:

    - To begin with, is the following code correct?

    No! You have to change this line:

    {
        return installFunc(lRealHandle, DataCallBack, (DWORD)(*refnum));
    }

    to these lines:

    {
        if (refnum && *refnum)
            return installFunc(lRealHandle, DataCallBack, (DWORD)(*refnum));
        else
            return installFunc(lRealHandle, NULL, 0));
    }

    And that's all! Do not touch anything else in the code. Rebuild the DLL then.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.