Jump to content

UserXXX

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

UserXXX's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Because it's not necessary to send this kind of packet I decided only to receive them. And yes, receiving these packets should be possible by dissecting this big cluster into parts by calculating received string lengths and unflatten these known-offset parts separately. Arrays I need are usually the last component in a packet after header so I can calculate the offset for the array and unflatten it separately (hoping the type for unflatten function is ok just by defining array constant without initialising it's size). This UDP-problem can be solved this way, right now I have some more troubles with TCP-packets, but that's another story & topic... Thank you all! I'll be back soon...
  2. Thanks Tomi, so I'm trying to receive UDP-packet which I must unflatten from string to receive as a cluster. First I have to tell "unflatten to string" -function used cluster type. The problem is with arrays (see attachment). I'm not calling a DLL now, but I have to create some kind of wrapper with "CIN" which gives me a cluster(?) I can route to unflatten to string -function ("type")?
  3. $#!% happens... this 2D-array is inside a struct, and this whole struct is part of another struct, actually inside its "union" and inside this struct and its "union" there is also 1D-array [1400] (char type)... Actually I have to use LV:s "flatten string" also, because I must flatten these clusters to string before writing/receiving them with UDP/TCP-sockets. And it seems that it doesn't work if I just put normal arrays inside clusters... Have to read Rolf's advices once more... :headbang:
  4. Hmm... I have to think a little bit more... How about 2D-arrays; how do I pass 2D-arrays by creating clusters? For example: 64 lines x 4 columns ? [long] Just add 4 "64 size long cluster" inside another cluster? (it doesn't matter which are columns/lines when dimensions & data type is correct?)
  5. Thank you Rolf. I made clusters inside clusters and it seems to work ok in this case. I still have some troubles; how do I create cluster from a large data array for example: unsigned char data[32768]; I tried to make it from unsigned char array constant, but "array to cluster" is limited to 256 elements? This array size is dynamic in C, but it would be better to allocate memory for maximum in LV? Array's size is huge anyway
  6. One more question about structures: How do I make it with LabVIEW, if there are sequences(structure name inside structure?), for example: struct First_coadd { double... long... short... char... ... } struct Second_status { First_coadd coadd; First_coadd coaddf; ... } Can you still help me with this...?
  7. Thanks for everybody so much! :worship: Everything works ok now, my problem was with memory allocation because of arrays inside clusters. LabVIEW rules...
  8. Hello, this must be very common problem when calling DLL:s, but still I haven't found clear and usable solution for it. I'm using LV 8.2 with DLL import wizard, but when I call a DLL, where are functions with parameters which are pointer to structures the wizard says "The function(s) are not declared in your header file." For example, structure "Example_name" in my header-file (64 bytes): struct Example_name { char one[32]; short two; long three; char four[3]; }; and my function "Example_function" in DLL: extern "C" CCONV Example_function (short something, Example_name *about); How can these structures be used when calling DLL with LabVIEW? Is it so that I can't solve this problem with DLL-wizard (by modifying the header-file, but I can't modify the DLL) and I must use normal calling node? I already tried to make a cluster and flatten it to a string, but after calling I get result only the first element value ("one"). (or only part of it; the first two bytes are "0" after calling). I made char one[32] -array to a 32-element cluster before flattening but it doesn't work anyway. I also tried to unflatten the string returned from DLL after calling but i get "generic error". (tried with different "endian" & "prepend array or string size" with LV flatten to string -function). Any good examples? Waiting for help & hoping for the best...
×
×
  • Create New...

Important Information

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