Externally Communicating to VWorks to Bravo

Hello! I’m working on a project to communicate to the VWorks directly. I would like to write custom code to control the Bravo through VWorks. For example, I run a script to tell the Bravo through VWorks to move a plate to a location and then run an external script to scan (some check happens here) and then VWorks will wait for a response that will determine what VWorks does next (pop up an error message or proceed to the next viable item to scan). I want to be able to send commands back but no clue how to approach this.

I know Agilent has a VWorks API and some documentation for this. But I am quite new to using VWorks and APIs, and don’t understand how I can start communicating to VWorks. I feel like I’m missing a whole lot of information and have been trying to ask some of the support folks.

If there’s any support or guidance on this, I’ll gladly appreciate ! Thank you!

@Beverly its pretty straight forward - how far did you get? Do you have Microsoft Visual Studio setup and the API installed?

@Pete I have Microsoft Visual Studio 2022 installed. I also have 2008 because I tried using the samplevworksclient on 2022 and had issues with the one way upgrade. Is the samplevworksclient you’re referring to as the API? And 2008 still didn’t work for me. :disappointed_relieved:

In your solution explorer, make sure you you have Interop.VWorks4Lib added as a com Reference. Right click on Dependencies select add Com Reference. then you can browse and add VWorks.exe as a reference and you should be able to reference the API in your project


Then you should be able to add using VWorks4Lib; (if your using C#)


@Pete Thank you so much! I have been looking for VWorks4Lib everywhere instead of the exe. It makes sense now. :clap:

Wonderfull! Let us know how your project turns out, the bravo is an awesome instrument!

1 Like

@Pete, I was able to add in the reference successfully and am using Visual Studios 2019. However, I’m running into an issue with the line “VWorks_= new VWorks4Lib.VWorks4APIClass();”

Hopefully this screenshot helps! I tried looking this up but am not understanding how to fix this. Thanks!

I am not sure, this is how i invoked the API

using VWorks4Lib;

VWorks4API vw = new VWorks4API();

To give an update and for others if they run into issues like me… turns out, the issues I’ve been having were Windows 11 related! :smiling_face_with_tear: I replicated everything on Windows 10 and didn’t have any issues. Seems like the API may not be ready for Windows 11? Thanks for the help @Pete !

1 Like

Hey Beverly, are you able to specify all parameters in a .pro from the API, or is more of just a start/stop command, that’s what it looks like from the documentation:

Ideally we would like to program .pro files outside of the Bravo Vworks IDE

Hi Colin,

Correct me if I’m misunderstanding you. You’re asking if I added parameters inside the .pro for the API? I didn’t modify anything in the .pro since all I needed to do was to start the protocol via the API. Is that what you mean? :slight_smile:

Hi Beverly,

Ahh we wanted more control than just starting and stopping. We wanted to send aspirate/dispense commands via the API, which I do not think is possible :frowning:

Unfortunately, I haven’t been able to do that directly from the API. I wonder if it’s possible if you can run an aspirate.pro and send parameters to the aspirate.pro and write some JS in the aspirate command to pick up info from your code? Just some food for thought. I haven’t played with that specifically, but I was able to run my protocols that does plate scanning w/ variable positions read from a text file… hopefully that gives you some idea??

Hmmm maybe someone else can give us some insight if possible!

Yeah, we are trying to attempt something like that right now.

How do you do dynamic plate positions from a text file? Is that from static deck positions?

The .pro files are xml files. You can write your own protocol editor that generates the xml or even modify a template protocol.

1 Like

Omg! Thanks again Pete! @cwehrhan What Pete said would help you (and me :wink:)-- and I’ll probably modify my .pro directly rather than through the JS. Originally, I had JS read txt files after my code has written them for VWorks to pick up :sweat:

1 Like