Jump to content

Taylorh140

Members
  • Posts

    91
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Taylorh140

  1. You know, now that you mention it. getTypeInfo might be the answer i was looking for the whole time. (i just remembered that i can scan the output and have a list of enumerated type descriptors instead of calling everything all the time.) #duh. So making a call to the get type descriptor each time will not be necessary. I implemented everything using vim's I like the flexibility but now i realize it was a bad idea because of how difficult it is to debug. For some reason I cannot cast a variant to a little endian representation of its data. which was one of the main hurdles here. Thanks @LogMAN
  2. When doing flattening by iterating clusters. I make a crazy amount of calls to get type info. I was thinking it might be better to loop through the type string. From Variant to flattened string, But I dont have a good reference for how to decode. (I usually reverse the needed info from the openg library.) If you have any doc's or wiki pages to reference i would appreciate it.
  3. I was working with some vims. and looking for a way to check rather the data was pink or brown. if brown i can simply typecast. but if pink i need to pad the strings to a fixed size. I didn't want to iterate the elements of the cluster to check for strings or arrays.
  4. Turns out i used the wrong calling convention. C for the Labview.exe
  5. @ensegre I can't get the snippet to work. @drjdpowell when i run this method i keep getting an issue with the ui locking up. I tried moving it to any thread. But it still only copies the string one time. Im attempting named shared memory. (attached file) I'm questioning calling the LabVIEW.exe from the LabVIEW.exe (should be ok right). SM_Host.vi
  6. So I'm working on windows and i need to write bytes to a pointer location. I can use windows api functions but i would guess that somewhere there is a function that does this? And perhaps is more portable? How is it done typically?
  7. Well that's way more useful than i thought it would be then. so no need to distinguish, and better portability. This makes much more sense.
  8. So I'm a bit confused right now. perhaps you can set me straight on this. I'm running x64 windows and 32 bit LabVIEW. but when i'm Call Library Function Node and calling a dll from (SysWow64) the "pointer sized integers" are 64 bits? I would expect them to be 32 bit for 32 bit LabVIEW as i don't think it can interact with 64 bit dll's regarless of the pointer size. and yes I'm sure that 64 bits would hold the value. However, since we need to match the c prototype, it makes me think this will cause problems.
  9. Is there a Labview Type that changes from 32 to 64 bits based on rather your running a different development environment?
  10. @FantasticNerd I don't make the rules, as far as this particular situation I can only speculate why. I would guess NDA would be required as well as other complicated approvals. In this case we are requesting a installer/setup procedure. but these things take time, in the meanwhile we are limited in testing. It's great the MAX/NIPM have a list of installed stuff. This is typically where i start too. Now wouldn't it be nice if NI just had a utility that looked at the exe, and made an installer that had all the components :).
  11. It just so happens that sometimes I am suppose to reproduce a test system made by a customer. There may have been an installer at one point but no-one knows anymore and they don't want to share the source vis. In the past i have download each NI library installed on that particular PC and installed it on the other until i get it all to play nicely. However it takes some time and is quite tedious. Is this the only way?
  12. @Rolf Kalbermatter I appreciate you mentioning this. I myself was weighing this. VI -> Smaller better for sharing examples but can have evil code in them. Slightly harder to make. Image -> Safer to share but lager and much more limited. Easy to make. I was originally leaning toward an image but, I think your right VIs are better. I don't think I've come across malicious VIs here, at least that i know of .
  13. Be careful of Pragma pack when your trying to line things up for larger types.
  14. I added what I have to https://github.com/taylorh140/Pgui. It's only right since I copied the enabling technology right from this forum. I don't know if ill have a huge amount of time to work on this but ill defiantly try and improve it when I can. There is still a lot of things that would be nice to develop for this.
  15. This is true. bad habit I guess. I used openGDS for this w/ EndevoGoop400, so far I like it. But it is still new to me so there are possibly design The enabling technology for this was from @Norm Kirchner so respect where it is due. Being able to translate images allows one to build a UI component and move it into place. Each drawn component can now pretend it is the only UI component on the picture control. I'll try to get a GitHub page published soonish.
  16. Two questions about this: 1. Does something like this already exist? 2. Is this something that could be useful? Every once in a while I need dynamic UI components that can be generated at runtime. One nice thing to use for this is a picture control; however it doesn't lend itself as well to keeping other pieces of function such as mouse click events and such. I put together a mini library of UI functions for this that has the ability to be extended. The UI can be generated dynamically at runtime and be any picture thing that you can draw. Using Standard layout techniques that you might find in other GUI libraries. The hierarchy generation can always be simplified by using some type of templating string. Example1.vi Front Panel on Pgui2.lvproj_My Computer _ 2021-07-02 14-03-54.mp4
  17. This may bet a better lead; It has a lot of similarity. https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject I have never seen this used. but it does seem to work. With similar performance.
  18. Something we can both be glad about. I think I might have a lead. https://stackoverflow.com/a/35389291 But ,I'm still not sure what's going on there, they clearly did a good job.
  19. In the example above I'm more interested in how NI implemented the waiting on the queue. It seems to have better performance than I would imagine possible. I probably made some bad assumptions on the example. Assumption 1: Two while loops run on different threads. Assumption 2: If threads yield to OS response of queue would be > 1ms on average. Assumption 3: If threads actively wait CPU usage would be high. Assumption 4: Neither of these methods make sense with the information collected.
  20. So lately I have been more interested in scheduling. Two methods I am aware of are below. This is in the context of Windows OS btw. Active Waiting (polling) Know for High CPU usage Accurate to less than 1ms Yielding OS wait (Thread telling OS give someone else my time slice) Very low CPU usage Takes OS integration (e.g. less portable) Much less time accurate jitter etc. expect best performance to be 1ms resolution So I have been curious about the timeout function of the deque element for a while. To me waiting on this seems to take little to no CPU usage. but has much better than 1ms resolution. 30us +- 10us in the example below. How can I replicate this kind of performance? Is there a secret method I am not aware of (reality says yes)?
  21. I tried to do a test to see if any of the windows fonts do anything. (forgive the long image). I'm starting to wonder if windows has this function in any form. perhaps there are some fonts that do work but the ones included with windows do not seem to do much:
  22. In The Draw Text at a Point VI under the user-specified font there are two settings that I do not understand. -Outline - seems like it should put a black outline or something around the text. as far as i can tell it doesn't do anything. -Shadow - seems like it should put a darker outline around part of the text. as far as i can tell it doesn't do anything. How do these work or lack there of?
  23. Wow, Thanks! It's good to be wrong. It does sound though I was right to be weary of calling DLL's meant to call LabVIEW functions, especially when LabVIEW versions change. But it sound like LabVIEW calls its own exposed functions (lvrt.dll i assume) when dealing with Queues. I wonder if building a dll for calling the queues and then debugging these would give me the prototype. (following the data to the builtin's) #unrecommended but a quick way to do devious things. (most likely learning that it is a bad idea and leaving it alone ha ha).
  24. I thought about this. I was initially turn off because code called from a dll supposedly runs in a different application space. I was concerned I would not be able to access queues by name through the divide. But I guess that plays well to me now knowing enough about the different run (domains) available to LabVIEW. I guess i wouldn't know where to look up the details for these. The Actor framework seems to use these. DLL calls can use these depending on the settings. -Is it just a head-free version of LabVIEW but sharing application memory? is this where the AZ and DS memory differences come in? more to learn here clearly. I got the PostLVUserEvent to work nicely.. I am working in Rust to see how the two play together, which is a new experience for me. It also gives some nice promises about how the safe code will work... but so far everything to do with this interface is currently unsafe :). This also means that most of the goodness of the language doesn't apply, but i can wrap up all the unsafe things in nice calls and get a good interface. Here is a sample of how the interface can look in rust. #[no_mangle] pub extern "C" fn AddONE(ptr:LvUHandle){ let h=LvArray1DW::<f64>::from(ptr); //Wrap pointer and get type as a 1D array of doubles. let g=h.to_array_mut(); // Access mutable slice for i in 0..g.len(){ g[i]=g[i]+1.0; // Add one to each element } } Note: I am using LabVIEW Handles for array in windows (but the pdf describing the interface says that windows array handles are not supported .. why?) Note Response: I guess the documentation says the Windows API does not support LabVIEW handles, like user32.dll not the LV interface to the custom DLL.
×
×
  • Create New...

Important Information

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