Page 2 of 3 FirstFirst 123 LastLast
Results 31 to 60 of 76

Topic: Direct CronusMAX Plus API

  1. #31
    Fastest Thing Alive

    User Info Menu

    Re: Direct CronusMAX Plus API

    To me it doesn't look like that a lot of people are actually using the API intensively. I might be mistaken, but only my request from a few months ago made the API be compatible with the combo .NET 4.0 / Windows 7 / C++. Swizzy made this happen basically within a day. So that's actually a pretty good customer service.

    Now let's see when (and if) we can use the ACC and GYRO parameters through the API. Swizzy said that this is a FW thing. My current project kinda depends on it... It's the beginning of the week. So let's see what's going to happen today. ;-)

  2. #32
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by lasac View Post
    Is the API still under active development? I am planning on using it intensively.
    I would say both yes and no, i'm not spending much time right now with it, but, if you find any issues or suggest something to add/implement, i will try to do so asap...

    Quote Originally Posted by hot955 View Post
    To me it doesn't look like that a lot of people are actually using the API intensively. I might be mistaken, but only my request from a few months ago made the API be compatible with the combo .NET 4.0 / Windows 7 / C++. Swizzy made this happen basically within a day. So that's actually a pretty good customer service.

    Now let's see when (and if) we can use the ACC and GYRO parameters through the API. Swizzy said that this is a FW thing. My current project kinda depends on it... It's the beginning of the week. So let's see what's going to happen today. ;-)
    Firmware updates take a bit longer to do, i'm not sure if the firmware team is working on this tho...

  3. #33
    Fastest Thing Alive

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    Firmware updates take a bit longer to do, i'm not sure if the firmware team is working on this tho...
    Can you ask? It would be nice to have the functionality. The API offers it, the enumeration for the ACC and GYRO parameters exists... and so I was even doubting myself at first what I do wrong when I implemented the feature. I was then double checking with... ummm.... "the other device", where it works flawlessly. That's when I knew that it's a CM issue.

  4. #34
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Ok good to know. Development will start this week.

  5. #35
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    When creating a CmCommandEx / CmCommand / Outputbuffer with the constructor set i would expect that the given output would be set with the parameter.

    var cm = new CmCommand(16, new int[] { 100 }); when sending cm to the device it does not work as expected. When setting the Output16 to 100 it does work as expected.

    Additionally, when you have the time it would be nice to have comments in the api, in the code.

  6. #36
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Shouldn't this press and release?
    // Press button.
    Device.SendApiModeData(new CmCommand() { Output16 = 100 });
    // Release button.
    Device.SendApiModeData(new CmCommand());

    It keeps pressing

  7. #37
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by lasac View Post
    When creating a CmCommandEx / CmCommand / Outputbuffer with the constructor set i would expect that the given output would be set with the parameter.

    var cm = new CmCommand(16, new int[] { 100 }); when sending cm to the device it does not work as expected. When setting the Output16 to 100 it does work as expected.

    Additionally, when you have the time it would be nice to have comments in the api, in the code.
    The constructor takes an array with the values for each of the outputs, setting a single one like you did there isn't really what it was designed for, the constructor kinda expects you to set the values for each one, you can use a initalizer aswell instead of the constructor if you need to set a specific one to a specific value, you would do something like this:

    var cmd = new CmCommand { Output16 = 100, Output15 = 100 }; // This would set Output 16 and 15 to 100

    I'll try to write a few more comments for the samples, which is what you're asking for i assume? any particular area you would like me to start with?

    ** edit: **

    You're sending them too fast actually, it doesn't allow you to immediately send another CmCommand, you have to wait atleast 10ms before you send the next one, i'm not sure right now if i did it the same as in Cronus PRO (where i simply discard any unwanted CmCommand, i'm fairly certain i return a boolean when you request to add it tho which tells you the status)
    Last edited by Swizzy; 18th January 17 at 16:44.

  8. #38
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Awesome thanks for the quick replys. The comments would be comment blocks in the API. I have read the docs, but its easier to press F12 and read the comments in visual studio and not having to open the doc file. Sure, the api is pretty 'straight forward' but when starting, the comments blocks would really help out! Again thanks for you quick responses!

    Edit: nice, sleep did the trick! thanks.
    Last edited by lasac; 18th January 17 at 16:51.

  9. #39
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by lasac View Post
    Awesome thanks for the quick replys. The comments would be comment blocks in the API. I have read the docs, but its easier to press F12 and read the comments in visual studio and not having to open the doc file. Sure, the api is pretty 'straight forward' but when starting, the comments blocks would really help out! Again thanks for you quick responses!

    Edit: nice, sleep did the trick! thanks.
    I'll try to get XML documentation done today, that's what it's called btw, even if they're defined in a similar way to comments to not disrupt the code... i make no promises tho, it might not be done until this weekend as i'm doing a few other things at the same time...

  10. #40
    Fastest Thing Alive

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    You're sending them too fast actually, it doesn't allow you to immediately send another CmCommand, you have to wait atleast 10ms before you send the next one, i'm not sure right now if i did it the same as in Cronus PRO (where i simply discard any unwanted CmCommand, i'm fairly certain i return a boolean when you request to add it tho which tells you the status)
    I have even managed to crash the API by sending commands (way) too fast (< 10ms). The API just stopped doing anything. Only when I unload everything and initialize the API again, then it worked again.

  11. #41
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by hot955 View Post
    I have even managed to crash the API by sending commands (way) too fast (< 10ms). The API just stopped doing anything. Only when I unload everything and initialize the API again, then it worked again.
    That means i messed up the api somewhere, wish you would've told me this earlier so i could fix it =) (i can't fix bugs i don't know about )

  12. #42
    Fastest Thing Alive

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    That means i messed up the api somewhere, wish you would've told me this earlier so i could fix it =) (i can't fix bugs i don't know about )
    Sorry! But I only ran into this just about a bit over a week ago. I was trying to read the controller and push the data to the PS4 as fast as possible, to see how much CPU it uses and how "slow" I can send it without creating any lag. It works with a Sleep of at least 10 ms. Anything lower starts to make the API unresponsive.

  13. #43
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Hello,

    New to the forum here and had a question or two about the WpfSample project in C#.

    I loaded everything up using Microsoft Visual Studio. The project bulids without error and works fine however, when double clicking on "MainWindow.xaml" the follow error occurs.

    Main Window: "Invalid Markup".
    XAML Window: Highlights LEDSelector "Value"
    Error List: "The member "Value" is not recognized or is not accessible.

    If I start deleting these I can get the MainWindow to load - but quickly run into other issues. Does anyone know how to solve this problem?


    Second: I was hoping to get a little help with something.

    What I'd like to do is create a loop (timing adjustable down to 10ms) that outputs all controller button presses, thumbstick movements, trigger pulls etc, to a text file with a timestamp of each. This would be fine if done after "Start I/O Requests" is clicked in the Device I/O Status screen. The text file could stop recording controller outputs when the "Stop I/O Requests" button is pressed.

    Any help would be greatly appreciated!

    Thank you.
    -Embalmer
    Attached Images Attached Images

  14. #44
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Embalmer View Post
    Hello,

    New to the forum here and had a question or two about the WpfSample project in C#.

    I loaded everything up using Microsoft Visual Studio. The project bulids without error and works fine however, when double clicking on "MainWindow.xaml" the follow error occurs.

    Main Window: "Invalid Markup".
    XAML Window: Highlights LEDSelector "Value"
    Error List: "The member "Value" is not recognized or is not accessible.

    If I start deleting these I can get the MainWindow to load - but quickly run into other issues. Does anyone know how to solve this problem?


    Second: I was hoping to get a little help with something.

    What I'd like to do is create a loop (timing adjustable down to 10ms) that outputs all controller button presses, thumbstick movements, trigger pulls etc, to a text file with a timestamp of each. This would be fine if done after "Start I/O Requests" is clicked in the Device I/O Status screen. The text file could stop recording controller outputs when the "Stop I/O Requests" button is pressed.

    Any help would be greatly appreciated!

    Thank you.
    -Embalmer
    That error should go away if you close the designer, compile the project then open the designer again, it's something i see all the time with WPF when a custom control is used which isn't part of another library and when a property on said control is being used like this case...

    The way to do what you ask for is to have a thread running that sends a RequestIOStatus command and having a eventhandler for the IOStatusChanged (this event has all the inputs/outputs in a object for you to use...

    You probably should stick to windowsforms if you're new to programming as WPF can be a bit tricky to handle at times

  15. The Following User Says Thank You to Swizzy For This Useful Post:


  16. #45
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    That error should go away if you close the designer, compile the project then open the designer again, it's something i see all the time with WPF when a custom control is used which isn't part of another library and when a property on said control is being used like this case...

    The way to do what you ask for is to have a thread running that sends a RequestIOStatus command and having a eventhandler for the IOStatusChanged (this event has all the inputs/outputs in a object for you to use...

    You probably should stick to windowsforms if you're new to programming as WPF can be a bit tricky to handle at times
    Thanks for the reply Swizzy.

    Closing the designer, recompiling, and re-opening unfortunately is not working as you suggested. For your reference I'm using a fresh install of Visual Studio Community 2017 edition.

    I'm not new to coding but I am new to WPF. I'm figuring things out and I already have an output working - but it's rudimentary at best. It's outputting everything regardless of change - so I'll try using the IOStatusChanged as you suggested. Should be much better.

    Thanks for the help.
    -Embalmer

  17. #46
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Embalmer View Post
    Thanks for the reply Swizzy.

    Closing the designer, recompiling, and re-opening unfortunately is not working as you suggested. For your reference I'm using a fresh install of Visual Studio Community 2017 edition.

    I'm not new to coding but I am new to WPF. I'm figuring things out and I already have an output working - but it's rudimentary at best. It's outputting everything regardless of change - so I'll try using the IOStatusChanged as you suggested. Should be much better.

    Thanks for the help.
    -Embalmer
    IOStatusChanged doesn't tell you which buttons/sticks etc. Changed from previous state, it merely tells you that a new IORequest Response was recieved from the CM, i can probably implement a way to get separate events for each Input/Output if you would prefer it that way?

    I will look into the WPF Sample project and see if it's something i can make properly work with the designer in VS 2017, I've only used VS 2015 for this particular project...

  18. The Following User Says Thank You to Swizzy For This Useful Post:


  19. #47
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    IOStatusChanged doesn't tell you which buttons/sticks etc. Changed from previous state, it merely tells you that a new IORequest Response was recieved from the CM, i can probably implement a way to get separate events for each Input/Output if you would prefer it that way?

    I will look into the WPF Sample project and see if it's something i can make properly work with the designer in VS 2017, I've only used VS 2015 for this particular project...
    Sounds great Swizzy!

    Currently the way I'm doing it is I have edited IoStatusDisplay.xaml.cs. After line 96 I added a series of checks to see if In00.Value != status.InputStatus.Input00 and so on. It works for the most part however, I'm seeing a bit of a problem with getting accurate thumb stick press data. I believe I'm "missing" the press or release at times possibly because of the loop timing or because there is other thumb stick traffic. Not sure what's going on there. If you have some better thoughts on how to do it that would be great!

    And yes, possibly there's some differences in VS 2017 that are causing the issue with the designer.

    Appreciate all the help Swizzy!

    -Embalmer

  20. #48
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Actually I found the issue with my thumbstick presses... it was due to how I was writing the strings. Thanks again

    -Embalmer

  21. The Following User Says Thank You to Embalmer For This Useful Post:


  22. #49
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by Swizzy View Post
    IOStatusChanged doesn't tell you which buttons/sticks etc. Changed from previous state, it merely tells you that a new IORequest Response was recieved from the CM, i can probably implement a way to get separate events for each Input/Output if you would prefer it that way?

    I will look into the WPF Sample project and see if it's something i can make properly work with the designer in VS 2017, I've only used VS 2015 for this particular project...
    Swizzy,

    Oddly enough the designer just started working. I didn't do anything different - one day it just started working. Strange.

    On to my next topics:

    1) If I wanted to connect several Cronus devices to the same APP (WpfSample for example), what would be the best way to do that? Currently I have to run several instances of the application to connect multiple devices but would prefer to do that in one application.

    2) Is there a way to pull the serial number or device ID info off of the cronus? Since I want to plug in several cronus devices at once, I'd like a way to identify which is which easily.

    Any help is greatly appreciated!

    Thanks again!
    -Embalmer

  23. #50
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    The current API was only designed for single device communication...

    The current API does not translate the Serial at this time, i did write another version of the API that is much better (can handle multiple CM's simultaneously and can do almost everything you can do with CronusPRO, pretty much everything except for programming the firmware/slots) however, i am not allowed to share it at this time :/

  24. #51
    Babyfaced Assassin

    User Info Menu

    Re: Direct CronusMAX Plus API

    When will the next API be available Swizzy?

  25. #52
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by stickweed View Post
    When will the next API be available Swizzy?
    When i'm given ideas of what's missing, the alternative edition i wrote isn't mine to share, it's private for the people i wrote it for...

    It'll probably take some time before any further updates can be released

  26. #53
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    I've made a minor update attached to this post, basically the new version has protection against potential deadlocks caused by the events, this is something that was requested by Embalmer recently after he experienced a freeze at one point (communicated to me via PM)

    The new version is also signed and has xml documentation
    Attached Files Attached Files

  27. #54
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    Hello bros,

    I have a problem with run list step press button.

    Anyone have example code in WPF or C# please help me.

    Thanks a lot.

  28. #55
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Quote Originally Posted by RongK9 View Post
    Hello bros,

    I have a problem with run list step press button.

    Anyone have example code in WPF or C# please help me.

    Thanks a lot.
    Can you explain what it is you need in more detail?

  29. #56
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    I trying to press button step by step like

    Left -> Up -> right -> Down ...

    But sometime the button doesn't press.

    I use the interval is 0.1s

  30. #57
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    Can you show the code you've used to try and do this that isn't working?

  31. #58
    My Other Ride Is a Yoshi

    User Info Menu


  32. #59
    Forum Admin

    User Info Menu

    Re: Direct CronusMAX Plus API

    First thing i notice, you're running it ever 10 100's of a NANO seconds, not 0.1s like you think, use this: TimeSpan.FromMilliseconds(10); instead of new TimeSpan(10);

    For reference: https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx (what you use) https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx (what i recommend using), keep in mind that this will only hold the buttons for 10ms as you're sending a empty buffer if there is no command, you do probably want to have the timer run on a 40ms interval to mimic what we usually do for rapidfire mods

  33. #60
    My Other Ride Is a Yoshi

    User Info Menu

    Re: Direct CronusMAX Plus API

    I'm not sure I reply on right topic. But It hard to find the right topic to post this question.
    My question is:
    "How could I press LX, LY, RX and RY used cronusmax Lib?"

    I cant find the right output used the WPF example.
    Please help me.

    Thanks a lots.

    - - - Updated - - -

    Thanks for the answer. I have the new truble one. Thanks a lots.

Page 2 of 3 FirstFirst 123 LastLast

Similar Topics

  1. USB connect direct to PS4 or USB hub?
    By rampar in forum DriveHub Hardware Support
    Replies: 4
    Last Post: 26th October 17, 06:26
  2. Cronusmax direct API on vmware, need help!!!!
    By hapile299 in forum Macro & Script Programming Support
    Replies: 3
    Last Post: 16th August 17, 16:14
  3. CronusMAX PLUS - How to use Direct Input controllers with Xaim
    By GL0ZZ3N in forum CronusMAX PLUS Official Guides
    Replies: 9
    Last Post: 22nd July 17, 15:08
  4. Direct Input 360 Axis Fix
    By ChicKeN in forum CronusMAX PLUS Hardware Support
    Replies: 0
    Last Post: 11th November 14, 17:43
  5. Direct API Template
    By Nefylem in forum Cronus PRO Software Support
    Replies: 3
    Last Post: 14th April 14, 19:37

Posting Permissions

  • You may not post new topics
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •