These adverts are supporting the forum's costs and the products/services are not endorsed by the forum owners.
First have you tried?
Log in to Search the Forum for help!
Learn more about using FreeStyler at the FreeStyler WIKI HERE
Learn more about DMX in General at The DMX Wiki HERE

if all else fails and you need a fixture consider the fixture building service HERE

Getting Visual Basic 2010 to talk to FreeStyler

Discuss the latest developments or get support for them HERE.
Post Reply
User avatar
Mattotone
Android Dev (Moderator)
Posts: 1238
Joined: July 10th, 2007, 5:30 pm
FreeStyler Version: BETA
I Use FreeStyler for: Just for the Fun of it.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Mattotone »

Hi phil,

You was up later then I was lol.
Name space freestylerConnection
The class is sender
Methods are static so can be called inline

FreestylerConnection.sender.sendMessageFunction(byte[] message, int functionCode); // renamed SendCh message
FreestylerConnection.sender.sendCommandFunction(int command, int value)// renamed old sendMessageFunc


Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Pidea
Has mastered Fixture Creator
Posts: 39
Joined: February 11th, 2013, 4:33 pm
FreeStyler Version: 3.5.2
I Use FreeStyler for: Band

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Pidea »

Thanks for those parameters Matt, I changed everything in my VB code and dropped yesterdays DLL in to the project and managed to connect as before. In other words, I can toggle blackout using the sendCommandFunction but can't send any DMX data.

I reckon that it's something to do with how the byte data is being handled within your C# library. It obviously works for you on your machine but it doesn't work here on a different environment.

I've spent a while this morning looking at your C# code and noticed that the declarations at the top where different - they are supposed to be IntPtr not int's apparrently ! So I went ahead and changed these and then had loads of errors due to mismatched types.

I've fixed all of these (with the help of Google as C# is not a language I know) and it now compiles but, guess what, nothing happens so I think it's time to bite the bullet and learn C# :o

Could you post the code to your listener class that you sent over yesterday ? I'll have a tinker with that and see if I can get it to read the DMX values that are getting sent in - it'll be easier than doing it with a library.

Ho hum !
User avatar
Mattotone
Android Dev (Moderator)
Posts: 1238
Joined: July 10th, 2007, 5:30 pm
FreeStyler Version: BETA
I Use FreeStyler for: Just for the Fun of it.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Mattotone »

hi phil,

Module Module1

Sub Main()
Dim b2() As Byte = New Byte() {48, 48, 71, 114, 101, 101, 110, 32, 67, 104, 97, 115, 101, 32, 82, 86, 83, 46, 99, 104, 98}
FreestylerConnection.sender.sendMessageFunction(b2, 5)
End Sub

End Module
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
User avatar
Mattotone
Android Dev (Moderator)
Posts: 1238
Joined: July 10th, 2007, 5:30 pm
FreeStyler Version: BETA
I Use FreeStyler for: Just for the Fun of it.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Mattotone »

New DLL file tested on windows 7 x64 and x86 using VB2010
You may need to run your app as Administrator
You do not have the required permissions to view the files attached to this post.
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Pidea
Has mastered Fixture Creator
Posts: 39
Joined: February 11th, 2013, 4:33 pm
FreeStyler Version: 3.5.2
I Use FreeStyler for: Band

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Pidea »

Hi Matt, now there's something happening but I can't quite put my finger on it ...

IF I use the latest DLL and run your VB code nothing happens - no cues are added to the cue window.
However, if I run your your latest message tester then run your VB code again, a cue called Green Chase RVS appears in slot 00.

This is a massive step forward - we've got some communication going on but it appears that I need to run your latest tester in order to flush any output ? Interestingly, the old version of the test ran as a Windows Forms app but the latest one is command line only - is that right ?
User avatar
Mattotone
Android Dev (Moderator)
Posts: 1238
Joined: July 10th, 2007, 5:30 pm
FreeStyler Version: BETA
I Use FreeStyler for: Just for the Fun of it.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Mattotone »

Ah. The new tester is written vb its the compiled code I posted. The console app is sender and the win forms is receiver.
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Pidea
Has mastered Fixture Creator
Posts: 39
Joined: February 11th, 2013, 4:33 pm
FreeStyler Version: 3.5.2
I Use FreeStyler for: Band

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Pidea »

As in this:

Code: Select all

Sub Main()
Dim b2() As Byte = New Byte() {48, 48, 71, 114, 101, 101, 110, 32, 67, 104, 97, 115, 101, 32, 82, 86, 83, 46, 99, 104, 98}
FreestylerConnection.sender.sendMessageFunction(b2, 5)
End Sub
Interesting, I'll have to ensure that the function that I use to turn a string into a byte array outputs the same.

I've got a long drive tomorrow to Norfolk (five hours+ from here) so I'm off to bed now but I'll take a look at this tomorrow evening. I'll let you know how I get on. Feeling much more optimistic now :-)

Thanks again for your help !
Pidea
Has mastered Fixture Creator
Posts: 39
Joined: February 11th, 2013, 4:33 pm
FreeStyler Version: 3.5.2
I Use FreeStyler for: Band

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Pidea »

Quick update: it looks like there are significant differences between .Net on older Windows platforms (specifically Windows XP) and the newer 64-bit versions. As a result it doesn't look like it's possible for a Visual Basic app to talk to Freestyler if they are both running on Windows XP unless the VB app is developed in VB6 which is what FS was developed in.

But ....

VB 2010 (and presumably later versions although I haven't confirmed this) can talk to Freestyler using Matt's library on the 64-bit platforms (Windows 7 and Windows 8) so development of my program continues now that I've bought a Windows 8 laptop.
User avatar
Mattotone
Android Dev (Moderator)
Posts: 1238
Joined: July 10th, 2007, 5:30 pm
FreeStyler Version: BETA
I Use FreeStyler for: Just for the Fun of it.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Mattotone »

my library has also been tested on windows 7 32 bit, so can confirm that windows 7 32bit is supported.
I dot have a xp development machine to compile my code, but will test the compiled versions on it.
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
User avatar
Mattotone
Android Dev (Moderator)
Posts: 1238
Joined: July 10th, 2007, 5:30 pm
FreeStyler Version: BETA
I Use FreeStyler for: Just for the Fun of it.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Mattotone »

any updates
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Pidea
Has mastered Fixture Creator
Posts: 39
Joined: February 11th, 2013, 4:33 pm
FreeStyler Version: 3.5.2
I Use FreeStyler for: Band

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Pidea »

Hi Matt, yes I've made lots of progress now that I'm developing on Windows 8 on a new laptop. I just couldn't get anywhere on Windows XP for some unknown reason.

I'm just adding, er, doing battle with MIDI support so that I can trigger sequence changes from my Roland percussion pad which outputs MIDI and then I've got a few bugs to fix before I'll release it.

All being well, that'll be in the next few days.
User avatar
Mattotone
Android Dev (Moderator)
Posts: 1238
Joined: July 10th, 2007, 5:30 pm
FreeStyler Version: BETA
I Use FreeStyler for: Just for the Fun of it.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Mattotone »

All good, I also battled with midi as theres not many examples or documentation out there. Coupled with a lack of pInvoke knowledge. Managed to do it although I cant get midi device names.
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Pidea
Has mastered Fixture Creator
Posts: 39
Joined: February 11th, 2013, 4:33 pm
FreeStyler Version: 3.5.2
I Use FreeStyler for: Band

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Pidea »

Take a look at this class Matt: https://code.google.com/p/midi-dot-net/ It's what I used and allows you to get MIDI names. The documentation is a bit cryptic but I figured it out in the end - I'm just too old school to understand all this class stuff !

But I'm getting there !
Pidea
Has mastered Fixture Creator
Posts: 39
Joined: February 11th, 2013, 4:33 pm
FreeStyler Version: 3.5.2
I Use FreeStyler for: Band

Re: Getting Visual Basic 2010 to talk to FreeStyler

Post by Pidea »

Hey Matt, finally got my app live: viewtopic.php?f=38&t=5217

Thanks for your help again !
Post Reply

Return to “FreeStyler 3rd Party Addons and utilities”