Jump to content

alvise

Members
  • Posts

    209
  • Joined

  • Last visited

Everything posted by alvise

  1. I managed to get the image .It's exciting to be this close after a winding road
  2. No, I don't want you to waste any more time, if you can tell me what to do, that would be enough. Since there is no other alternative, I have to compile the code and continue. maybe I can find the conversion dll for the SDK itself. So I have to deal with it somehow. HMODULE hDLL = LoadLibraryW(L"HCNetSDK.dll"); if (hDLL) { Type_SetStandardDataCallBack installFunc = (Type_SetStandardDataCallBack)GetProcAddress(hDLL, "NET_DVR_SetStandardDataCallBack"); if (installFunc) Since "HANDLE" is written here (7 argument of type "HANDLE" is incompatible with parameter of type "HMODULE" hikvision-labview there was a problem. I changed it to HMODULE, a bug was resolved. typedef BOOL(__stdcall* Type_SetStandardDataCallBack)(LONG lRealHandle,fStdDataCallBack cbStdDataCallBack, DWORD dwUser); LibAPI(BOOL) InstallStandardCallback(LONG lRealHandle, LVUserEventRef* refnum) , Error (active) E0020 identifier "fStdDataCallBack" is undefined hikvision-labview callback - x86-Debug D:\HIKVISION\hikvision-labview callback\hikvision-labview callback.cpp 46 I'm getting this error but what I don't understand is that there are no tokens here hikvision-labview callback.cpp
  3. If I understand you correctly, if you are talking about error outputs, there is no error here. If you say give up, let me compile the code you shared in the next step and continue.
  4. I guess there is no error in start.vi because according to the NET_DVR_RealPlay connection datasheet, it is possible that it takes a value of 0. Logging into the device returns the product serial number and everything correct. No errors occur here. The Session output here sometimes gives a value of 0 and sometimes 1 every time the start is pressed.
  5. Ok I tried that and saw labview but my attempt to see video stream fails again. That's not the problem here. Looking at the SDK user manual I read the same thing. This shouldn't be a problem.
  6. I'm not talking about the complexity of the code you wrote, there are too many details, I'm just talking about the confusion in my head while trying to wrap up the general situation. This situation gets a little confusing. Your code is pretty clean I'm running the start.vi code directly as you shared and I'm actively using the 32-bit domain. Also I am using LV2018.I cannot find FP.NativeWindow in VI property node.I'm getting the thought that this might be the problem.
  7. Since it is overwritten with bundle, no matter what I enter there, nothing will change, you're right, sometimes I forget what I know in the mess
  8. Thanks for your comprehensive explanations. First of all, I would like to go over the sample code you shared, if we are sure that this code will not work, I would like to move on to dll compilation in the next step. When I tested the code you shared, I recaptured the wire values with the images below. And I took the photos as below. Something is not right here. Do you think there is a problem? If you say skip this example, I will skip this example. I will move on to the next steps you wrote.
  9. Do I understand correctly what you are saying? I still need to create a .dll in C++ to use the labview code you shared here. I need to compile the code below (after adapting the part added as C# code to C/C++ language) and create the .dll file, right? If this step is correct I think I need to make some plugin in the labview code you shared that should get this callback.Live video output can be seen after adding the callback plugin as well. There is probably nothing as difficult as putting the pieces together in this confusion. -Not:I don't have a chance to use 64-bit labVİEW, currently I can only use 32-bit.
  10. When the new calback function worked the correct HCNetSDK location, it created a connection and read the camera's information. Now the connect and Start button works, the labview does not crash, there is only a small problem, there is no image. -What could be the reason for this? The description here mentions the callback event. That shouldn't be a problem, right? Did you choose NET_DVR_RealPlay specifically because it has this function NET_DVR_RealPlay_V30
  11. Do I need to add something like the following to the empty.vi file here? The .dll file created with the Call library function here should be called. and the dll file to be created should contain the following code. Is there such a situation?
  12. Thanks for the example. I tested this application, but after running it and pressing the connect button, the labview crashes as it is. It does not read the device's information.I need to close Labview completely.I couldn't figure out why I couldn't connect. Everything seems right though
  13. Thanks for your answers. On Shaunr's suggestion, I focused on C#. I think I misunderstood the issue. But it's not bad, I gained a little more experience. I leave aside the issue of communicating with labview using C#. The piece of code I have created with labview so far has been created using only the HCNETSDK.dll file and this dll file has been created using C++. There is also the HCNETSDK.h file. At the point of What can I do now, I've come to this wing, correct me if I'm wrong. - I need to write a piece of code in C++ and in this code I need to communicate with the labview by importing the extcode.h header file and using the PostLVUserEvent function. I will do this just to understand the communication between the dll I created and the labview. Doesn't this example here already do that? -In C++ code, I will import the header file HCNETSDK.h and extcode.h, then call the PostLVUserEvent function and adapt the callback from labview with this function to the following snippet and finally I will compile this code and create a dll file. //Set exception callback function NET_DVR_SetExceptionCallBack_V30(0, NULL,g_ExceptionCallBack, NULL); //--------------------------------------- //Start preview and set to callback stream data LONG lRealPlayHandle; HWND hWnd = GetConsoleWindow(); //Get window handle NET_DVR_CLIENTINFO ClientInfo = {0}; ClientInfo.hPlayWnd = hWnd; //If need to decode, please set it valid. If want to get stream data only, it can be set to NULL ClientInfo.lChannel = 1; // Preview channel NO. ClientInfo.lLinkMode = 0; /* The high bit (31) 0 means the main stream, while 1 means the sub stream. Bit 0~bit 30 are used for link mode: 0- TCP mode, 1- UDP mode, 2- Multi-play mode, 3- RTP mode, 4- RTP over RTSP, 5- RTSP over HTTP */ Below is the C++ sample code I can use. I have taken into account your suggestion to run the Labview code in the while loop. C++ live stream.cpp
  14. Something that comes up just when trying to guess is "PostScript". then I will add different letters there. OK? Saves a photo with the attached code to the location where the labview code is located. Currently the code is bound to the event indexed button so it takes a picture and the program is stopped, when it is stopped it is recording a picture. Should I go to the marathon right now? I also want to pass, but I don't know exactly how. To use the PostLVUserEvent function, the extcode.h header file must be added to the C# code, but that is a separate event for how to do it in C#. hikvision 7.0.1.vi
  15. -I understand the situation a little more. JPEG can only be used for snapshots. -I can compile the sample application now. We can make changes to the interface or other functions. Now I have taken the next step. I think this is "实时流数据.ps." It's a PS (PostScript) extension, isn't it? I will change the name. I'm trying to understand the situation by looking at the example here. But how can I adapt this to the code I'm using?
  16. thanks for the answer. What I really needed was to go step by step. I will inform you after I have followed each step. I tested the application created as preview.exe, everything works correctly.I can compile preview.js. I am currently trying to compile it. I can see the function names you mentioned here in HCNetSDK.dll. So you're talking about the possibility of using them directly to receive video streams? but I will go through everything step by step and give you feedback.
  17. Thanks everyone for the replies. Right now, I'm pretty confused. I've looked through all the searches on Google, but I've been looking blankly as there are a lot of things I can't understand at the moment. Some reasons why I am confused: -First of all, I'm trying to prepare a dll file with C++, but how can I create it? For example: Here is the code How am I going to use the code here as an output function. -second case, I'm looking at the examples here.Is ''iCube Camera in'' here a wrapper dll file? what? -third case: How is the "Reg Event Callback" mentioned by ShaunR used in my case and what is the problem in its use? -fourth case: dadreamer , what do you mean by labview may bite you in addition to not fully understanding how to use the event you mentioned? -finally: I know there are many ways to reach that stage, but I'm asking to get the whole thing in my head.How do I use the video screen output? Is the .Net function used or how? It would really help if someone could tell me how to proceed step by step because I can understand it with practice. Everything is abstract for me right now. Thank you for any ideas given.
  18. good answer This camera's SDK is shared, but I have insufficient knowledge of C++ or C# when trying to generate the required code. After a long hiatus from using the C++ language, even looking at the visual studio code editor, I feel like I was forgotten on mars. This indicates that I need to work again to create the required dll file. Although at first it seemed like something I could only do with labview, now I'm starting to understand the depth of it. With dadreamer help, we can read the information from the camera with the labview, but there is a problem in the video stream part. I'm reviewing the code here. I am researching and reading useful information. https://forums.ni.com/t5/Sample-Code/Post-Events-to-a-LabVIEW-Event-Structure-From-a-Dll/ta-p/3996283
  19. Thanks for your answer. I'm a little confused, the truth is that the SDK previews shared by the company are all written in C#. 1-Preview-PreviewDemo.zip
  20. Looking at the C# example, I'm trying to gather the labview code and understand how to use the callback event, and I added the renewed code (I don't know if I'm progressing correctly). There are some things I still don't understand. In the C# example, "pUser" and public void RealDataCallBack(Int32 lRealHandle, UInt32 dwDataType, IntPtr pBuffer, UInt32 dwBufSize, IntPtr pUser) { if (dwBufSize > 0) { byte[] sData = new byte[dwBufSize]; Marshal.Copy(pBuffer, sData, 0, (Int32)dwBufSize); string str = "ʵʱ������.ps"; FileStream fs = new FileStream(str, FileMode.Create); int iLen = (int)dwBufSize; fs.Write(sData, 0, iLen); fs.Close(); } IntPtr pUser also in this line. m_lRealHandle = CHCNetSDK.NET_DVR_RealPlay_V40(m_lUserID, ref lpPreviewInfo, null/*RealData*/, pUser) Extra: What I want to create now is just a screen that shows the video and the PTZ control. Is it possible that this is that hard in Labview? Am I the only crazy one who wants to control these cameras with labview why no examples hikvision 7.1.vi
  21. How exactly can I create the callback function in labview. The callback event is a bit complicated I guess. Does the wrapper Dll you mention have to be written specially? Now this situation is starting to seem quite complicated for me
  22. I noticed this while researching ''HCNetSDK.NET_DVR_RealPlay_V40'', wouldn't it help? https://open.hikvision.com/hardware/definitions/NET_DVR_RealPlay_V40.html Thanks for your help, it's really a difficult situation that can come out of it. At least for now, it will be useful if I can only read the video.
  23. Thanks for your help. -With this camera, it does not appear as a direct usb com port with NI-IMAQdx. Because it needs to encode MPEG4 or H.264 video, but labview only supports MPJEG. -Video can be streamed over VLC RTSP, but the video is delayed. The C# code I want to create is as attached. It contains the PTZ control. I guess I need to search for the wrapper DLL. While examining the C# example(Preview.cs), I saw that ''HCNetSDK.NET_DVR_RealPlay_V40 '' is used for video streaming. I guess this does not change the situation. Preview.cs PreSet.cs
×
×
  • Create New...

Important Information

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