LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CIN MoveBlock mmaped Memory

Hello!
You advised me to use MoveBlock function.. but it doesnt work.

In my C source code I have mmaped memory using function "mmap" it returns a pointer of type (unsigned char *).
Then I set char (or uChar) (tried both): char vertiba = ptr_to_pci_mem[1]
And I want see data on indicator. Tried different types of indicators, even string indicator. Tried using MoveBlock function and nothing.
Please help me with this question, where am I wrong? what should be done for realizing this task?
#Code:
......
......
MgErr CINRun(uChar String);

MgErr CINRun(uChar String)
    {
......
......
    unsigned char *ptr_to_pci_mem;
    #define PCI_MEM_LEN 2097152
    ptr_to_pci_mem = mmap(NULL, PCI_MEM_LEN, PROT_READ|PROT_WRITE, MAP_SHARED, fd, (off_t)pci_mem_addr);
    MoveBlock(&ptr_to_pci_mem[1], &String, 2);
......
......
Waiting for your wise advices and answers.
0 Kudos
Message 1 of 9
(3,586 Views)
Hi BL,

Could you continue on your original thread please.

Thanks
Van L
NI Applications Engineer
0 Kudos
Message 2 of 9
(3,570 Views)
Van_L: oh that was different thread, relating to enother program code.
By mixing together different program codes it made misunderstandings with Rolf.K.
sorry for this.
0 Kudos
Message 3 of 9
(3,538 Views)
do I need to use LStrHandle for Moveblock ?
ptr_to_pci_mem = mmap(.... ) - returns unsigned char pointer to memory
0 Kudos
Message 4 of 9
(3,537 Views)
Hi BL,

I am not too familiar with textbased code.
I'll try to look into the moveblock function.
Van L
NI Applications Engineer
0 Kudos
Message 5 of 9
(3,506 Views)
Rolf.K, I solved this problem 🙂 by the way - without any "MoveBlock"
0 Kudos
Message 6 of 9
(3,443 Views)
Hi BL,

Awesome, you found a solution.
Do you mind sharing what you did to overcome your problem mentioned in this thread so other users can benefit from it too

Thank you in advance
Congrats again
Van L
NI Applications Engineer
0 Kudos
Message 7 of 9
(3,441 Views)
OK, this program works for Linux, does it fit your interest?

Message Edited by bI on 04-17-2008 06:00 AM
0 Kudos
Message 8 of 9
(3,407 Views)
Your solution of any kind will definitely benefit other users in the future

Thank you for sharing your solution

Van L
NI Applications Engineer
0 Kudos
Message 9 of 9
(3,398 Views)