Jump to content

labviewbeginner1

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by labviewbeginner1

  1. I already tried it with this functions but then i get all the time a runtime error or buffer is too small. Can you please help me? its urgent. if i would have time to read books then i wouldnt post it here and search for help . when i did it like above: pubtable.serialnr_A = interntable.serialnr_A; i get at least the adress of the value (it seems like that). i know that you should not treat it like that. But i need a way how to to give the string to the struct and then i make my memcpy for the struct to transfer it to labview. So i dont know how the c string should look like (length and byte-size) that i can transfer it to labview. And how could i make it in Labview to get the value if i would get this adress from the pointer? Or is it only solveable with C? if you can post a code-example how i can implement it by me in C and Labview i would be grateful. Update: Actually i saw that the result should be "0204". This means in the memory 0x30, 0x32, 0x30, 0x34. So it is in my opinion 4 byte big. Is it somehow possible without transferring the wchar to a char in C that i can make this visibile in Labview?? or what can i do?
  2. I think so too. But do i have to realise it in Labview different or in C?? In C i have this: declared in the structure "char *serialnr_A;" copied in the function which i use in my CFN: pubtable.serialnr_A = interntable.serialnr_A; Or how can i solve this?
  3. Ok now it worked at least somehow. I get the attached output. In the bottom of the picture you see the block diagram I think i have to add something in the block diagram, to convert something. Because in the fourth and fifth row it is written "46022880" and "46022976" but it should be written "0204" (because i know the serialnumber of this device and its 0204) how can i solve this problem? i tried to change the display format but this wasnt the solution. Greets
  4. ok i got my mistake. i dont need memcpy. Because C takes Arrays like pointer so i can just say this: pubtable.serialnr_A = interntable.serialnr_A; Now i dont get a runtime error. I will soon test it with the transfer to labview and keep you updated. sincerly Labviewbeginner
  5. ok if i do it in the header like this: char *serial_A; make instead of strcpy a memcpy of the serial_a Variable into the struct like this memcpy(pubtable.serialnr_A, sizeof(strlen(interntable.serialnr_A)), interntable.serialnr_A); i will get a runtime error. I want to make it as simple as possible and i think what you said about this pointer solution and in LabVIEW about an integer would be the easiest way. (instead of the 256 u8 elements). Because then i have just 8 integer in my cluster which is in an array of 16 entrys and this should work. But something got wrong with my C code. i will put the C-File attached again. Thanks for the fast help. Project1.zip
  6. Sorry for the late answer. But i forgot my password and had to make a new account. i will send attached my Test.vi and my C-Code. it worked now when i wanted to transfer an array of structs with 7 integer. But this was just a test. In fact i need an array of structs and each structs has 7 integer AND an char array (i want to get the serialnr of a device). But if i make it, something is kind of wrong. There is also picture attached how it should look. I dont know where my problem is maybe someone can help me. greets sincerly Project.zip
×
×
  • Create New...

Important Information

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