Visual Basic Script in CVI 9.0
Hi
I'm trying to control a Lecroy oscilloscope with GPIB commands in CVI, and also I have
Automation Manual describing the controlling commands written as VBScript.
I want to use some of these commands, but I cannot call them in CVI.
Thanks
Solved!
Go to Solution.
Hello,
You will need the Remote Control Manual for your scope as well.
Here is a link to our Remote Control Manual:
http://www.lecroy.com/files/manuals/WM-RCM-E_Rev_D.pdf
Here is one to our Automation Manual:
http://www.lecroy.com/files/manuals/Entire_X-Stream_Automation_Manual.pdf
And finally, here is one for the Automation Command Reference Manual:
http://www.lecroy.com/files/manuals/Automation_Command_Ref_Manual_WR.pdf
The Remote Control Manual will have the IEEE 488 (GPIB) commands.
The Automation Manual will introduce you to the XStream Browser (an application on the scope) and the Automation Commands. (The automation commands can be used when there is no equivalent remote command).
The Reference Manual will cover all of the Automation Commands.
When you send an automation command in the 488 format, it has to be sent with the VBS command (covered in the remote control manual on page 71 and in more detail on page 248).
It is also covered in the Automation Manual on page 1-28 (This actually shows the syntax to use)
Cheers,
Leonard Brown
LeCroy Applications Engineer
1-800-553-2769
Similar Messages
-
Need help creating full battery alert using visual basic script
Hi,
I have been searching for resources, programs and code that will create an alert for me to unplug my charger when my laptop
battery is charged to full (or almost full).
The only problem with this code is that
Line 13: iRemaining (or RemainingCapacity called from BatteryStatus returns a 0 (might be a floating point which I can't figure out why). I even checked the microsoft documentation and its supposed to be a percentage.
I want to get either the current percentage of the battery or the total Fullchargedcapacity and the EstimatedRemainingCapacity to find the % of battery level.
Essentially what I am asking is how can I return the battery % using visual basic script.
Help!
The Code:
1 set oLocator = CreateObject("WbemScripting.SWbemLocator")
2 set oServices = oLocator.ConnectServer(".","root\wmi")
3 set oResults = oServices.ExecQuery("select * from batteryfullchargedcapacity")
4 for each oResult in oResults iFull = oResult.FullChargedCapacity
5 next
6
7 while (1)
8 set oResults = oServices.ExecQuery("select * from batterystatus")
9 for each oResult in oResults
10 iRemaining = oResult.RemainingCapacity
12 bCharging = oResult.Charging
12 next
13 iPercent = ((iRemaining / iFull) * 100) mod 100
14 if bCharging and (iPercent > 95) Then msgbox "Battery is at " & iPercent "%",vbInformation,"Battery monitor"
15 wscript.sleep 30000 ' (30 seconds)
16 wend14 if bCharging and (iPercent > 95) Then msgbox "Battery is at " & iPercent "%",vbInformation,"Battery monitor"
On my Windows 7 machine your script returns the desired percentage (after adding the missing "&" to the right of "iPercent" in Line 14). -
Running a Visual Basic Script...
Hi,
Is there a way to run a visual basic script from a director project?
ThanksYou can use Buddy API to run a vbs script file.
ie.
baOpenFile( _movie.path & "My Script.vbs", "Normal" )
You could also try the inbuilt open command but I haven't tested it. -
How Can I run a .vbs (Visual Basic Script) file on Linux?
Hello, I have a doubt:
How Can I execute on Linux a .vbs file? I can't use wine cause it is not a .exe file.
Is there any way?
GreetingsMikko777 wrote:http://www.cyberciti.biz/tips/visual-ba … linux.html learn to use google
Google works, yes ... if you know what you are searching for. Try this search: VisualBasic is not VBScript.
Here is what you will need (consult an attorney first):
- Wine
- Windows Scripting Host (WSH) 5.6* (available officially from MS website, but requires validation):
http://www.microsoft.com/downloads/deta … laylang=en
* There is an update to 5.7 also available form MS
- You will also need (from your Windows installation):
mfc42.dll
- Once you have the files placed in your Wine '/system32' folder (via installer or extraction), you will need to register dll files. At minimum, I think you can get by with:
wine regsvr32 /path/to/vbscript.dll
wine regsvr32 /path/to/wshext.dll
Others may be required ... if you get more messages alerting you to register files, just repeat for each one necessary. Or register them all and be done with it.
Once you have WSH setup, you can launch the VBScript file by opening 'winefile' and double clicking on the script. From the command line, you will need to launch it with 'wscript':
wine wscript "Z:\\home\\user\\.wine\\dosdevices\\c:\\Program Files\\test.vbs"
If you attempt to launch the VBScript with just:
wine "Z:\\home\\user\\.wine\\dosdevices\\c:\\Program Files\\test.vbs"
you will get a message about 'BAD EXE Format' or similar.
Last edited by MrWeatherbee (2007-11-09 15:03:36) -
Visual Basic Script is not installed or has been disabled
I have installed the newest version of Windows script form Microsoft. Ihave enabled this in my internet options, i have also tried and retried to install itunes. Won't let me. What am I doing wrong? I just bought this ipod and am very close to returning it? Is there a phone number for apple? This is soooo ridiculous
try working through the techniques from the following document (that you haven't already tried):
iTunes and QuickTime for Windows: What to do if the Installer crashes with a 2738 error -
Error while Using the Visual Basic Script Job Definition Type for Non-SAP
Hi,
when using VBScript Job Definition Type I got the following Error:
Input Error: There is no file extension in "C:\Program".
When I run the Script locally on the Server it runs fine.
Using CMD Job definition on the same platform agent runs also fine.
Is there maybe a wrong setting or are there any parameters to configure to run VBScript Job definition ?
Best Regards Torsten RehageHi,
yes it is a bug. I had contact with my redwood consultant.
He sends the error to the developer. I set the datarootdirectory to a path without blanks and it works.
Thanks
Torsten -
Visual Basic RFC SAP no-unicode. Latin2 Caracteres are converted in '#'
Hi,
I are inserting data in Z SAP tables from a Visual Basic Script.
I are doing a RFC call.
The problem is that the data type text aren´t iserting correct when its are Latin2 caracteres.
Example:
Text in Visual Basic: "Prevozni strou0161ki-železniu0161ki"
But when theRFC function inserts the data in SAP, SAP shows "Prevozni stro#ki-#elezni#ki".
Could somebody help me??
thanks in adavanced,
JaviThanks for your answer.
But i din´t solve the problem.
I changed the encoding to UTF-16 and ISO-8859-5 but the caracteres are inserting bad yet :(.
I'm debugging the visual basic code and I can see that the text is correct in Visual Basic, but after it is incorrect in SAP.
Too, I'm inserting the value directly in visual basic sourcecode:
T_BAPI_P.Value(index, "TXZ01") = "Prevozni strou0161ki-železniu0161ki NOVO"
But the result is the same.
SAP shows "Prevozni stro#ki-#elezni#ki NOVO".
I have seen that in the transaction SM59 you can specify if the RFC conexion will be UNICODE.
The SAP system that i am working isn´t unicode, then it can not the tag to especificate this in SM59.
Could it be the problem that the SAP system isn´t unicode??
sorry, for my English's low level.
Thanks in advanaced for all yousr answer!
Javi -
Is posible execute script PLSQL in Visual Basic 2008?
Hi, i'm a beginner in PL/SQL. And i have a question:
How is the procedure for execute script PL/SQL on clic a button in a visual basic 2008 form. Coud you help me please.
I'm sorry for my english but i only speak spanish.
Thanks
Edited by: Edgar Molina on 7/11/2009 08:34 PMSomething like this
Dim sqlStr As String
sqlStr = "DECLARE " & vbLf & _
"your vars declared here " & vbLf & _
"BEGIN" & vbLf & _
"your pl/sql code here " & vbLf & _
"EXCEPTION" & vbLf & _
"your excepltion handling here " & vbLf & _
"END;"
Dim comm As New OracleCommand(sqlStr, MyOracleConnection)
comm.CommandType = CommandType.Text
MyOracleConnection.Open()
comm.ExecuteNonQuery()Max -
Crystal Report 10 and Visual Basic 6 - logon failed in crystal report viewe
Guyz,.
Report viewer is showing logon failed, pelase help me, i can able to view the data from rs1(recorset).
please hellp me to fix this issue, i need to pass the sql query to my pre designed Crystal report which has all the field as same as SQL query.
Please suggest me if any other alternate way to do this , my code is below.
Environment : Crystal Report 10, Visual Basic 6
cr_preview -> CrystalActiveXReportViewer
RepName -> Fiename and path of the Crystal report is designed from Crystal Report Designer.
Function show_rep(Sql As String, RepName As String)
Dim crystal As CRAXDRT.Application
Dim report As New CRAXDRT.report
Dim rs1 As New ADODB.Recordset
If rs1.State Then rs1.Close
rs1.Open Sql, cn, adOpenStatic, adLockReadOnly
Set crystal = New CRAXDRT.Application
Set report = crystal.OpenReport(RepName)
report.DiscardSavedData
report.Database.SetDataSource rs1
'cr_preview.Refresh
cr_preview.ReportSource = report
cr_preview.Visible = True
cr_preview.ViewReport
Do While cr_preview.IsBusy
DoEvents
Loop
cr_preview.Zoom 100
If rs1.State Then rs1.Close
Set rs1 = Nothing
Set crystal = Nothing
Set report = Nothing
End FunctionHi,
Please refer to the link for the list of example, [click here|http://pscode.com/vb/scripts/BrowseCategoryOrSearchResults.asp?optSort=Alphabetical&lngWId=1&B1=QuickSearch&txtCriteria=crystalreport+10&blnWorldDropDownUsed=TRUE&txtMaxNumberOfEntriesPerPage=10&blnResetAllVariables=TRUE]
Regards,
Clint -
ActiveX privileges different in Labview than Visual Basic
Trying to make some ActiveX calls to a 3rd party app with LV 7.1. I am able to access many methods and properties, but one of the methods I call gives me a "insufficient user privileges" error from the app. Realizing y'all know nothing about what causes that error in the app, my question really is "If I write the exact same set of calls in Visual Basic, I don't get the error, why not?" What does LV do differently at that level? I have looked at the Dcom configuration manager and have set security to none on all apps, but again, since VB has no problem, it is unlikely that it would help, and sure enough, it did not. You may say, "ask the developers ", but none of then know how LV implements it's ActiveX so they say it is Labview's fault and of course NI will say it's an incomplete implementation of ActiveX. Any ideas?
thanksHi ET,
The behavior of your LabVIEW application is quite interesting since any
true copy of the ActiveX script from another programming language into
LabVIEW has always given the same results as with the text based
program. However, one thing that could be the difference it the
conversion of data types, especially when the Variant data type is
involved. To further troubleshoot what is going on, please submit a
simple example that shows the issue. I would prefer if you could submit
the Visual Basic code and the equivalent LabVIEW VI, thanks.
- Philip Courtois, Thinkbot Solutions -
Hi, I am getting a small application developed in visual basic 6.0, this application is taking screenshots and saving them in as gif images, but the size of the file is too big upto 2-3 mb which takes time to send them thru email in real time. please if
someone could help me, need code in VB 6,0 to make these files small so that they can be sent in real time thru email.... Or Need a code in VB 6.0 to automate snipping tools. Thanks SanjivHi, I am getting a small application developed in visual basic 6.0, this application is taking screenshots and saving them in as gif images, but the size of the file is too big upto 2-3 mb which takes time to send them thru email in real time. please
if someone could help me, need code in VB 6,0 to make these files small so that they can be sent in real time thru email.... Or Need a code in VB 6.0 to automate snipping tools. Thanks Sanjiv
VB6 programmers are gods of programming! You may be interested in the following Visual Basic 6.0 open source projects (surely you will solve the problem with these projects):
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=74904&lngWId=1
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=71666&lngWId=1
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=44137&lngWId=1
There are thousands of VB6 advanced codes for image compression (many of them contain new algorithms for compression), choose one :) -
Hi
I opened a PDF file in a Visual Basic form.
When I open "Open full Reader search not show " look i.
Not work use advanced search.
Can you help?
LucianoOne - Reader Forum http://forums.adobe.com/community/adobe_reader_forums
Two - Developer Forums
Acrobat Scripting Forum http://forums.adobe.com/community/acrobat/acrobat_scripting
or
Acrobat SDK Developer Forum http://forums.adobe.com/community/acrobat/acrobat_sdk -
LabView TEDS library into DLL or ActiveX Control so that I can use it in C or Visual Basic?
We are developing software in LabWindows/CVI and Microsoft C. I heard that LabView can generate DLLs. Can I turn LabView TEDS library into DLL or ActiveX Control so that I can use it in C or Visual Basic development environment?
Technically what you are proposing is possible with LabVIEW. With LabVIEW's application builder, VIs can be built into dlls. Also, LV has ActiveX hooks and so you could create a system for calling into it from CVI. However, this is not what I would recommend.
The LabVIEW VIs have been written to a preliminary version of the IEEE specification (1451.4) that describes the TEDS data which is primarily why I'm advising you against using them. Once the IEEE spec is approved (the current timeline is currently late March), it will become public and you can write your own code according to the specification (or wait for someone else to write it). To help you get started, the spec includes flex and bison code that describes the syntax and structure of the template files
Internally, we've written some C, C++ and Java code to the preliminary version of the spec and we've found that we can duplicate the functionality of the TEDS Library for LV in roughly 2 weeks in any other language. -
Can anybody translate this one-line Visual Basic into AppleScript?
I have been pulling my hair out in trying to get InDesign CS4 to markup selected text with an XML tag. Supposedly this can be done using Visual Basic. Is there anybody out there that could possibly translate this seemingly simply code into AppleScript?
myText.AssociatedXMLElements.Item(1).XMLElements.Add("break", myText)
Here is another example:
With myTSRangeText.AssociatedXMLElements.Item(1).Parent.XMLElements.Add("znak")
 Call .Markup(myTSRangeText)
End With
I am still thinking that AS cannot do this… but it is worth a shot to ask.
Thanks in advance,
JeffIf it makes any difference
This is what I have so far using AppleScript. It is very very close. But the result of running the script appends the tagged text to the end of the text in the frame. In other words, it looks like this: (assuming I had the characters "word" highlighted). This is because I can only seem to tell the story to markup using the tag. I cannot tell the selection to markup using the tag?
This word is the item I want to tag.[word]
I am wanting the result to tag the selected item. So it should look like this:
This [word] is the item I want to tag.
tell application "Adobe InDesign CS4"
tell document 1
set selText to object reference of (text from character 1 to character -1) of selection
set selTextString to selText as string
display dialog selText as string
set parentStoryID to parent story of selection
set myXMLTag to (get XML tag "theDate")
set myXMLStoryTag to (get XML tag "Story")
tell XML element 1
set theStoryElement to make XML element with properties {markup tag:"Story"}
tell theStoryElement
set myXMLElement to make XML element with properties {markup tag:"theDate", contents:selTextString}
tell parentStoryID to markup using theStoryElement
end tell
end tell
end tell
end tell -
Help visual basic users need help with compiling a .dll!!
I just need someone to compile this .dll for me please since i dont have a visual basic. Thanks in advance!
link: http://shrib.com/1Lso3eMG
It's an online notepad I used to compile a little script for something. Please and thank you!Hi,
Perhaps you can use this:
https://msdn.microsoft.com/en-us/vstudio/hh388573
As this question is not reporting an issue with the forums, I'll move this thread to the 'Where is the Forum For...?' forum.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)
Maybe you are looking for
-
How to create sales order Automatically with reference to contract?
how to create sales order automatically through batch or online? can anyone please suggest what needs to be change in SAPMV45A program?
-
Error With JDBC receiver adapter
Hi Guys, I am working with File to Jdbc scenario.at the file side the process is working fine.the file is picked up by the file adapter and send it XI.then XI sends the data to JDBC it shows an error in receiver side.the error is as fol
-
Is it legal to publish (for free or for a price) a song made using garageband autoplay loops? I edited one of the loops a touch. Just don't want to get in any legal trouble. Thanks
-
My iphone does not seem to be working with the av composite cable brought from apple store worked fine until update to ios 6.0.1 help
-
World minutes Office 365 subscription cover the Fa...
Hi there, I have a funny query. My country of origin is the Faroe Islands, which politically is a part of the Danish kingdom, along with Greenland. It does however have a different area code to denmark. Since it is such a small country it sometimes l