FAQs

 

Tech Notes

 

 

 

 

FAQs-ActiveX

How do I control multiple RP devices through ActiveX?

Why do I get an error message when I try to connect to the black inputs on a Component?

How do I change the name of a SourceFile component while my program is running?


Question: How do I control multiple RP devices through ActiveX?

Answer: Make an ActiveX control for each hardware device that you want to control. Then you can call ActiveX functions on each of the individual hardware devices. For example, the following Matlab code makes ActiveX controls for 2 RP2s and a PA5 and connects each of them:

RP2_1 = actxcontrol(‘RPco.x’, [5, 5, 26, 26]);

RP2_2 = actxcontrol(‘RPco.x’, [10, 10, 31, 31]);

PA5 = actxcontrol(‘PA5.x’, [15, 15, 36, 36]);

invoke(RP2_1, ‘ConnectRP2’, ‘GB’, 1);

invoke(RP2_2, ‘ConnectRP2’, ‘GB’, 2);

invoke(PA5, ‘ConnectPA5’, ‘GB’, 1);

>> Back to Top

Question: Why do I get an error message when I try to connect to the black inputs on a Component?

Answer: The black inputs are static parameters and can not been modified after the circuit is loaded. In most cases another component will allow you to access the relevant parameter. For example, if you need to modify the rise/fall time of a gated signal you can use the LinRamp instead of the Cos2Gate or the LinGate. If you need to acquire a signal or play out a variable length signal, you can use the SerStore or the SerSource.

>> Back to Top

Question: How do I change the name of a SourceFile component while my program is running?

Answer: The name of a SourceFile cannot be changed during run-time. However, there are ways to get around this. Instead of using a SourceFile component, have your program open the file, read the data into an array, and then use WriteTag or WriteTagV to load the data into an RPvds buffer. This way, your code can open whatever files are necessary. Eliminating the SourceFile component also takes some of the load off of the RPx processor.

>> Back to Top