LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When

Hi,
 
Try this modification. (attached picture)
Remember to change the data type of "end_addr" to Unsigned 8-bit integer.
 
 
I hope this can help.
0 Kudos
Message 11 of 27
(2,254 Views)
I tried it, but it doesn't work.
0 Kudos
Message 12 of 27
(2,245 Views)
It is still empty
0 Kudos
Message 13 of 27
(2,237 Views)
I do a return statement to see the number of characters it should return and print it to the screen. It is giving me a value which means I should be displaying something but its not. I'm not really sure y.
0 Kudos
Message 14 of 27
(2,217 Views)
1- Does you DLL file function correctly? Have you tested it in C environment?
 
2- I've noticed a minor point in your DLL c code. you defined data as: "unsigned char* data". In C there is no difference in the result of using "unsigned char* data" and "unsigned char *data", but they have different meanings. This is just a guess, but test it! change your DLL so that it has "unsigned char *data" instead of "unsigned char* data"
 
3- add short delays between sequence frames
 
Hope any of these suggestions van help.
0 Kudos
Message 15 of 27
(2,201 Views)
I created an executable file in C and ran it. It prints out the message to the screen so I know the function works, but it doesn't want to return anything in Labview.
0 Kudos
Message 16 of 27
(2,194 Views)
All I can say is: Try the 2nd way in my last post.
 
unsigned char* data: is pointer data type that points to an unsigned byte and "data" is of that data type.
unsigned char *data: is unsigned char data type that "data" is its pointer.
 
I guess that your C code may run correctly if you use any of these type declarations, but LV may not. just try it and let us know too.
 
 
0 Kudos
Message 17 of 27
(2,189 Views)
I tried that and I still get the same result.
0 Kudos
Message 18 of 27
(2,187 Views)

Hmmm, challenging!

one more ideaSmiley Wink

use a serial port monitoring program. such programs sniff serial port without taking it. I've used them myself and the results were amazing. in this way you can at least find if the port will be opened and closed properly. you also can monitor all data that are wriiten to/ read from the port.

you can search for such programs, but I've used this one. It is good enough. try trial version of its professional type!

I hope that it can help.........

0 Kudos
Message 19 of 27
(2,180 Views)
Hi,soroush and Newguy100.
I tried so many times and failed so many times to use DLL returning an array pointer!
But last night I tried another way and it works.I used CIN instead of CLF.The idea was from NI's code example HERE. If you study the code it may help.Newguy100,maybe you can try CIN too.Perhaps our problems are the reason of data structure's deference between C and LV?Or the memory management of LV is a mystery. Smiley Wink  I guess,not sure.
 
0 Kudos
Message 20 of 27
(2,168 Views)