Page 1 of 1

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 27 Mar 2013, 08:40
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

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 27 Mar 2013, 11:18
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 !

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 27 Mar 2013, 23:36
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

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 28 Mar 2013, 00:12
by Mattotone
New DLL file tested on windows 7 x64 and x86 using VB2010
You may need to run your app as Administrator

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 28 Mar 2013, 00:35
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 ?

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 28 Mar 2013, 00:40
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.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 28 Mar 2013, 00:46
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 !

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 31 Mar 2013, 23:18
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.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 01 Apr 2013, 09:46
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.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 16 Apr 2013, 23:57
by Mattotone
any updates

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 17 Apr 2013, 00:02
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.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 18 Apr 2013, 13:03
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.

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 18 Apr 2013, 14:30
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 !

Re: Getting Visual Basic 2010 to talk to FreeStyler

Posted: 03 May 2013, 15:53
by Pidea
Hey Matt, finally got my app live: viewtopic.php?f=38&t=5217

Thanks for your help again !