LFindanno / ArduinoSCPIParser2

Instrument side SCPI parser
1 stars 1 forks source link

Multiple parameters #1

Closed parnalp closed 6 years ago

parnalp commented 6 years ago

Hello,

Is it possible to make a command tree with multiple parameters as input using this library. For Ex: APPL:SIN 455E3,1.15,0.0 the APPLy command is specifying a sine wave at a frequency of 455 KHz, with an amplitude of 1.15 volts, and a DC offset of 0.0 volts.

If yes, can you please provide me with an example.

LFindanno commented 6 years ago

Hi, the main goal of this library is to provvide a callback for arbitrary commands. When the a callback is executed you have as argument the first pointer of a linked list of values (struct scpi_token in the header file) http://www.learn-c.org/en/Linked_lists .In your case the linked list contain 455E3, 1.15 and 0.0. Take a look in the SignalGenerator example code starting from the line 104.

parnalp commented 6 years ago

Hii,

I am not very clear about what you are trying to explain, but what I can see is from the Signal Generator example is: It only takes one parameter in the main Command with frequency in range 0 to 25MHz , and frequency is the only parameter you pass. Here, what I wish to do is send for example, the frequency with time for example in a single command. Your command -> :SOURCE:FREQUENCY? 500Hz My Command -> :SOURCE:FREQUENCY? 500HZ , 100 so my command has one more parameter of 100ms time in same command with a separator "," So, is this possible to do with this library, If yes.. I would really appreciate an example for understanding. Because I have no idea how to do it.

Thanks.

On 17 April 2018 at 11:58, luigi notifications@github.com wrote:

Hi, the main goal of this library is to provvide a callback for arbitrary commands. When the a callback is executed you have as argument the first pointer of a linked list of values (struct scpi_token in the header file) http://www.learn-c.org/en/Linked_lists http://url .In your case the linked list contain 455E3, 1.15 and 0.0. Take a look in the SignalGenerator example code starting from the line 104.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/LFindanno/ArduinoSCPIParser2/issues/1#issuecomment-381929876, or mute the thread https://github.com/notifications/unsubscribe-auth/AYCTdbjOXo7HqfS73u2aA0exiOLSJNF3ks5tpbzigaJpZM4TTZ2s .

LFindanno commented 6 years ago

This code is heavly C based, if you don't understand things like data structures, linked lists and pointers in C language, we can't speak each other. Anyway, if I'll find the time, I'll write a simpler code to explain how it works. In the meanwhile try to learn the mentioned arguments, it will be very usefull.

parnalp commented 6 years ago

I figured it out by myself. Thanks