Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does this mean..?

Status
Not open for further replies.

groundhog1

Electrical
May 4, 2003
43
I am in excel learning to use VBA so that I can simply try to get a marker value from an Agilent network analyser. I have one of their .xls examples and it does all kinds of things to the analyser, but I can't seem to figure out how to modify the darn thing!

THe analyser is on the network, and my computer is also on the network. The excel example file uses VBA that uses SICL-LAN (Agilent), that uses GPIB calls.

I am sure this is not too hard for somebody... it's just that my head is too hard... haha.

VBA issue:
What does the (1,1600) stuff do?
Dim Data_y(1, 1600) As Double
Dim Data_x(1600) As Double

SICL-LAN issue:
What is the diff between an iread and an ivscanf?
When would you use a scan instead of a read?

SICL-LAN issue:
What does the ", 6, 1, 0&)" part do?
Call iwrite(id, ":CALC1:MARKER1:Y?" + Chr$(10), 6, 1, 0&)

 
Replies continue below

Recommended for you

Hi groundhog1,

VBA issue:

Dim Data_y(1,1600) As Double defines Data_y as a two dimensional array of double precision numbers.

Dim Data_x(1600) As Double defines Data_x as a one dimensional array of double precision numbers.

I'm afraid I guessing about the iread, and ivscanf functions other than they are functions SICL-LAN has defined.

HTH
Todd
 
A little googling shows that your answer should be found inside the manual: or goto and search the technical support there-if you haven't done so already. Otherwise, maybe a more specifice forum on tek-tips.com might help...

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Yes thanks.
I am starting to figure this out a bit. The SICL part is the worst. Seems complex. But i am getting data from the network analyser now. So that is not so much an emergency now.

I am into the Basic programming stage at this point and now realize that i am not such a good programmer. My instinct is to just throw down a thousand lines of code in a row, with lots of messy variables and stuff... I am quickly building a birdsnest of a program. I need to learn how to do this right. Learning about making general purpose modules that I can call repeatedly...ohwell..

I have another VBA question though..
When creating modules or subroutines in VBA, sometimes they are added to the main program and sometimes they are in their own module window. What is the difference and why would you create another module window for some code?

Thanks,
groundhog
 
When creating modules or subroutines in VBA, sometimes they are added to the main program and sometimes they are in their own module window.
Not exactly sure what you mean. If you are creating subroutines, they will be placed in whatever module you select. If you mean macro recorder code, these are typically added to a new module, even if one already exists. Event procedures, on the other hand, are created in the appropriate built-in class module (e.g. Workbook_Open in the ThisWorkbook class module)
What is the difference and why would you create another module window for some code?
As for standard code modules, where you would typically write most of your procedures, there is no difference. The main purpose is to group related procedures, data structures, etc. together as an aid to the programmer in development, maitenance and updating. The compiler doesn't care.


Regards,
Mike
 
The main benefit of using modules for sets of related functions and/or subroutines is so that they can be used easily in other programs (code re-use). I have one module used in many programs to do string handling, another to do odd math handling and yet another that opens and closes data connections and recordsets

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting

Steam Engine enthusiasts:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor