CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

SCPI(Standard Command for Programmable Instruments)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
shahram



Joined: 04 May 2009
Posts: 2

View user's profile Send private message

SCPI(Standard Command for Programmable Instruments)
PostPosted: Mon May 04, 2009 5:22 am     Reply with quote

Hi,
Has anyone written a SCPI (Standard Commands for Programmable Instruments??) for a PIC here?

Thanks
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon May 04, 2009 7:06 am     Reply with quote

A search shows one mention back in Feb 2008. Looking at the specs, it seems to be pretty straightforward and not very difficult to implement.
Guest








PostPosted: Tue May 05, 2009 1:21 pm     Reply with quote

I have - unfortunately I cannot share the code. Basically it is simple to parse, but takes a bit of string manipulation code.

Use strtok() to separate the commands (command groups are separated by ':')

Then search for matches to the long and short form of the commands in a string table that you make up that has all the commands.

You just loop through these down the command tree until the final match is found.

Remember that strtok() is not re-entrant - as it remembers what you did last. So usually I have to build several different versions of strtok() (with different names) so that I don't disturb the parsing that is going on above in the command tree.

If I can do it, then heck anyone can as I am basically a Analog / RF hardware engineer... So don't worry!

;-)


HTH - Steve H.
shahram



Joined: 04 May 2009
Posts: 2

View user's profile Send private message

PostPosted: Sat May 09, 2009 10:35 pm     Reply with quote

Thanks a lot, i am also a bio-electric engineer, but i will try to do that.
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun May 10, 2009 6:59 am     Reply with quote

Agilent has a website for x86 SCPI drivers that may of help as a reference.

http://www.home.agilent.com/upload/cmc_upload/All/ADNHome.htm
Steve H
Guest







PostPosted: Sun May 10, 2009 11:57 am     Reply with quote

Jpac soft makes a PC parser, but there is a lot of info on their website. This parser simply won't work on a PIC - it was meant for a PC. But it is very well done - If I was writing on an embedded PC That's what I would use!

Also you can try the scpi consortium for info on how the commands are supposed to work.

Personally - I have always just looked at how others implemented their commands - always try to stick with something that works - like Dave suggested.

HTH - Steve H
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group