NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

casting by pointer in the cvi itself

1. Is it possible to perform casting in the cvi by using only the pointer (void*) of a struct (container) which was created in teststand?
 
I've been trying to perform casting by using cvi's memcpy function, by all I've menaged to do is to change the first variable of the container, I just can't find
the location of the other struct variables
 
2. if casting isn't possible in the cvi (in the manner described at q.1) is it possible in the teststand itself?
 
let say I've got an array filled with data and I want to transfer it into container by using pointers (I don't know the container content), can it be done?
 
Regards Zohar
0 Kudos
Message 1 of 4
(3,374 Views)
Hi Zohar,

You should be able to pass an array from TestStand to CVI. Here are three links to othr forum threads that talk about a few different ways an array can be passed.

How to pass numeric array from TestStand to CVI DLL and vice versa?
How to pass several property types between TS and CVI code modules.
Passing Arrays to Operator Interfaces using UI Message.

Adam
Adam

National Instruments
Applications Engineer
0 Kudos
Message 2 of 4
(3,355 Views)

Thank you for your answer,

but it didn't help me because you recommended the usual way of passing structs.

What I'm trying to achive is to send the teststand struct pointer down to the cvi and in it to perform changes on the memory position

of the teststand struct, unfortently ,when I send the pointer down to the cvi I get NULL pointer; what ever I've tried doing just didn't work.

 

The reason I didn't want to pass the struct by the usuall way is because I will need to preapre a huge amount of structs in the teststand

and typedef in the cvi which will make life much more complicated, it just doesn't fill wright that I can't send the container pointer

to the cvi for what ever reason I desire.

 

Zohar

0 Kudos
Message 3 of 4
(3,316 Views)
Zohar,

It is currently not possible to access TestStand's memory from CVI in the way that you are proposing. It may be possible to access the variable from a sequence context pointer, which could then provide a similar functionality. This Developer Zone Tutorial  briefly talks about the sequence context and give the location of an example to review.


Adam

National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(3,278 Views)