Re: display a picture generated by a .net dll
Re: DLL access violation - unless caller's FP is open.
Well, the DLL looks really like a mix mash of styles. There are the two low level functions getDescriptor() and SendCommand() which look mostly like a copy past job from one of the Microsoft DDK samples and then the whole shenanigan around it which looks like from someone used to write low level embedded software in a C like language without quite all the features that real C has.
if I would be tasked to make this work I would throw away everything in that C code except the low level communication routines like SendCommand(), ConnectDrive() (and because ConnectDrive() uses it also getDesriptor()) and then write a proper session based wrapper around it so that a single DLL can handle multiple devices at the same time.
Such a DLL would take maybe 1 or 2 days to develop for me. The nice thing in this respect is that it could also be done all in LabVIEW with just the above mentioned 3 functions implemented with minor modifications in a DLL. Then write a LabVIEW class that maintains all the necessary data variables to drive these function in the class private data. It wouldn't be really less work but for someone not so inclined with C programming it would still be significantly easier.
Trying to debug this monster with multiple renamed DLLs in memory is something that easily takes a lot more time than that and still is hard to proof that it actually works reliable. Not crashing your app is absolutely no proof that everything is right!!
And I'm pretty sure the DLL is doing something wrong. With all those global variables accessed by your API calls and at the same time the background acquisition thread without much of a serialization through semaphores or something similar, this is bound to create race conditions at some point which can result in crashes very easily.
I would love to tackle this but I don't have any hardware to test it nor can I do this amount of work for just good karma alone.
Re: Reading String from SPI driver
Hi Alexander , I have tried it yes bits are coming in reverse order.
For unflattening the JSON string i have used it but i am not getting it. To make sure i have used the GUI given by Cheetah for windows and it is also giving me same string as the labVIEW is giving and that to in reverse order. I am getting error with JSON unflatten when i am using that. I am directly connecting the string to json unflatten module.
error is
JKI JSON Serialization.lvlib:JSON Lexer.lvclass:Run.vi:1530001<ERR>
Internal error
<b>Complete call chain:</b>
JKI JSON Serialization.lvlib:JSON Lexer.lvclass:Run.vi:1530001
JKI JSON Serialization.lvlib:JSON Lexer.lvclass:Tokenize String.vi:2030001
JKI JSON Serialization.lvlibarser.lvclass
arse Input String.vi:1590001
JKI JSON Serialization.lvlib:JSON Parser.lvclassarse JSON String.vi
JKI JSON Serialization.lvlib:JSON Deserializer.lvclass:Unflatten From String.vi:2180001
JKI JSON Serialization.lvlib:Unflatten From JSON String.vi:4940001
Cheetah Example SPI.vi
Re: Keithley 6517 real time measurement and sampling frequency
Hii pateIMIKES,
I am trying use your Labview program attached (6517.vi) in previous message but SUB-VIs of following were missing while running this program,
1. Keithey 6517 coulombs config.vi
2. Keithley 6517 Single read.vi
Can you send the Sub-VI files or Driver files you used for this program. Looking forward your reply.
Thanks in advance.
Warm Regards,
Jagadeesh G
Email: jagdeesh.g93@gmail.com
Re: Capturing STOUT/STDERR from C DLLs
@Rolfk:
So you're saying (among other things) that "run in any thread" would not make a difference? That it should work (but obviously might "mix" results)?
I thought "run in any thread" had a re-entrant like effect (separate memory space). Haven't given it much thought lately tough. If I understand correctly it only enables parallel execution. That does make more sense.
I guess at least "specify path on diagram" could be tricky, because LV might unload the dll if it's not used anymore? I think LV only unloads dll's when the call library node is called with another path.
Re: Image Acquisition and Line Profile
Hi,
I'm not sure what your actual problem with displaying the line profile is. But I would recommend to have a look at the example "Line profile.vi".
You find it via Help -> Examples or
LabVIEW\examples\Vision\2. Functions\Analysis\LineProfile Example.vi
Hope this helps.
Re: How to generate UDP traffic
Hi !
I have a similar issue with communication with a piece of hardware.
The problem is that it seems that my message is mixing characters and binary. Here is the data I have to send in each UDP packet (all data is send in little endian) :
4 bytes: 53591 (little endian)
2 bytes: 1 (little endian)
21 bytes: a name terminated by a '\0' character
40 bytes: all zeros
I tried to use the flatten to String VI to translate my data into string but it doesn't work (in the example above, the name is inexistant but I also tried to include some ASCII characters into bytes in the byte array, without success).
I also tried before to convert my whole message into a string of 0&1's and also a translation of the data into a hexadecimal string, and also a translation of the message to ASCII characters, all three trials without success.
Thank you in advance for your help !
Warning: Connection to the MyRIO-1900 hast been lost
Hey,
I am running a VI, which compares two camera Images and overlay the differences between both. this works like expected. but sometimes i am losing the Connection with the MyRIO target automaticaly or it does not even run. I then get the warning: Connection to the MyRIO has been lost or Deployment with Errors. but i can't see any Errors in my VI.
Can someone please get a look on my attached vi and may be tell me which mistake i am doing?
I use Labview 2016 and a Basler camera.
Re: display a picture generated by a .net dll
Hi,
Here is the LV 2014 version
Tension fantôme sur une des voies de ma carte d'acquisition NI 9234
Bonjour,
Je m'explique, sur une de mes voies d'acquisitions une valeur est apparu, et j'arriv plus à faire d'acquisition dessus. Les autres vois fonctionnent. Seulement cette voie serai t-elle HS ?
Merci pour votre retour.
Re: Capturing STOUT/STDERR from C DLLs
Run in any thread really only means that the Call Library Node is free to execute in whatever thread the VI is at that moment executing (and that will consume that thread exclusively for the function call until it returns back to LabVIEW as LabVIEW can't do its cooperate multitasking magic during the Call Library Node call, it doesn't have any hooks into the DLL to suspend its execution and assign the thread to other code clumps to execute).
As far as LabVIEW is concerned the DLL function is a complete black box that gets passed the input parameters on the stack (some registers too for 64 bit) and at some point returns with an optional integer return value in the EAX (or RAX for 64-bit) register, or the ST0/IMM0 register for floating point return values. For output parameters (parameters wired on the right side of the Call Library Node and defined as reference parameters in the C code) the parameters then returned back to the diagram.
Nowhere is any LabVIEW specific reentrancy (memory space) involved unless you start to play with the Callback functions in the Call Library Node configuration dialog and use the InstanceDataPtr in the call to your Call Library Node.
But functions that are called from any thread need to be fully reentrant capable to be safe to be called in that way, although that is not a strict requirement if you can guarantee in other ways that no global resource can be accessed concurrently by multiple/concurrent calls to any function in a DLL. But proofing that for not fully reentrant functions is anything but trivial and also usually hard to enforce for a casual LabVIEW programmer who is going to use your LabVIEW VI library in many very obscure ways.
Distributing a VI library that has the requirements that you have to call all the functions sequentially through some means like error cluster wiring in order to not crash is not very user friendly.
Re: How to generate UDP traffic
Hi Romain,
when you upload a VI you should also attach any needed subVIs!
THe main problem with your VI are the incorrect datatypes of the numeric constants.
See this example:
The datatype is given by the labels of the constants…
And please don't hijack 10 years old threads. Start your own thread instead…
Re: Unable to configure Xilinx IP block
Refer to this chart for compatibility between FPGA module and compilation tools version.
Re: Image Acquisition and Line Profile
I tried wiring line profile vi with my image acquired butgot nothing If possible please see my vi and modify it
Re: NI-IMAQdx CPU usage high when grabbing image from USB Camera
You definitely want to structure your IMAQdx code as Initialize and Open Camera, Create IMAQ Buffer, While [Grab Image, Display in Buffer], Close Camera. The While Loop should contain the Grab and Display, with Open and Close outside the loop.
What happens if you run this with only one Camera? Are you "happy" with the images you see?
What is the objective? For example, do you need to simply view images, do you need to save images? Do you need to see every image (i.e. if your camera acquires at 30 FPS, can you view every 5th image)? Do you need to see images from multiple cameras at the same time, or can you have a single Display and change which Camera's Images you are viewing?
Bob Schor
Re: NI 9411 for Serial Data
crossrulz wrote:Is your data stream following a standard? It would be easier if you got a module that just used that standard. Otherwise, it seems like you should be able to do what you want if you are using a cRIO and program the FPGA.
True. I am thinking in saving resources by using a NI 9411 32ch 1slot , instead of a NI 9871 4ports 4-6slots. If some programming is required to make that reduction, i would accept it gladly.
No, the data will be fed through a small PCB card I will design for this purpose. For converting a SPI/I2C sensor into serial data.
Re: NI 9411 for Serial Data
I made a mistake, i will restart the question.
Re: Image Acquisition and Line Profile
From vision analysis pallate I chose line profile vi and wired with my image output. Then created output indicator at line graph but neither this indicator was a graphical interface rather a array indicator. Neither it gave me any option to draw line for which is line profile was expected, I saw an option for line coordinate at input of line profile so how to give my line input from that displayed image I am not clear.
Re: How to remove serial number from a PC?
there are many reasons why someone do not want the serial # layed out. Simple, JUST CAUSE. Just answer thge question. It is simple, BTW this is bs site. What do u think? emakil me
Re: cummulative sum elements in array(one by one)
Hi, it was indeed easier than expected, I was taking it in the wrong direction.
I am sorry for having annoyed you with my vague question. Even if did not get the point of my single "m".
BR.