Modbus TCP:Is there any better way for reading registers randomly one or more?

Uncategorized
Question: We are writing a Windows Service to read the data from PLC using Modbus TCP protocol at the polling interval of 1 sec through Socket programming in c#. Windows Service will receive random registers of the PLC to read the register values. Expected registers randomly such as 40150,40250,40270,40320. From the above case how to create the Modbus TCP request header? We could found two possible ways:Using the function code 3, we can read the values of the registers on a specific range, for example from 40150 to 40320, in this way we can read these 40150,40250,40270,40320 register values. Another way is requesting these 40150,40250,40270,40320 registers one by one(this will cause performance problem). Am I missing any point here? Is there any better way for reading registers randomly one or…
Read More

confuse AdMob : Failed to receive ad: Request Error: No ad to show

ios
Question: a strange problem, I have create a app on Admob that linked to AppStore, then create AdUnit, integrate code '* Native ad template: M001' in app, but it report error 'Failed to receive ad: Request Error: No ad to show.' then I recreate a new app on Admob that not linked to AppStore, then create new AdUnit under the new app, it is the same type '* Native ad template: M001' I change the configure , AppID, Ad unit id, then the second works fine, but the first report error as above, class GMAds{ static var _isLinkedAppStore = true static func setup(){ GADMobileAds.configure(withApplicationID: "ca-app-pub-xxxxx~xxxx") if _isLinkedAppStore { }else{ GADMobileAds.configure(withApplicationID: "ca-app-pub-yyyyy~yyyy") } } static func getUnitId()->String{ var adUnitID = "ca-app-pub-xxxxx/xxxxx"// if _isLinkedAppStore { }else{ adUnitID = "ca-app-pub-yyyy/yyyy" } return adUnitID…
Read More

eclipse trying to load a class that does not exist anymoe

Uncategorized
Question: I have a big project and i decided to change some of the packages inside and also rename and delete some classes. After I did it I am getting an error of: java.lang.ClassNotFoundException: Main.Ser_Network. That class does not exist anymore and i have replaced it with a different class and changed all the references to it inside the project. I have also tried Project --> Clean. Nothing works and i don't know what else i can do. EDIT I created a brand new project, created new packages and new class file (same names) and i am still getting this error. How can i solve this issue? This is very important, any help would be appreciated. Thank you. Answer: Make sure that all references to the class are not in…
Read More

Using latin character sets for storing emails and domain names in MySQL

Uncategorized
Question: The generic advice on stackoverflow is to use utf8 or utf8mb4 everywhere in MySQL, even for fields that will only ever contain latin characters. What is the best character set for email field? best character set and collation for storing Tags, and URLs in MySQL DB To clarify, for a column containing only latin characters, would using utf8mb4:...result in a larger index and higher memory usage? ...use more storage space when using column type varchar(100) or char(100)? ...allow more than than 100 characters to be stored in column type varchar(100) or char(100)? Answer: It's 2017. Use utf8mb4 and VARCHAR(255) for every generic "string" field unless you have a very compelling reason to deviate from that. Even pure Engish speakers love to use quirky non-Latin characters in situations like "¯_(ツ)_/¯"…
Read More

How can I delete the last character of keys in JSON?

Uncategorized
Question: I need to clean up the JSON code below, by removing the last or last two characters in the KEY i.e. SCHREsubjects0 should be SCHREsubject. I expect large data sets or groups returned ("SCHREsubject0":"41C44DB","SCHREcontaccessment10":"87","SCHREcontaccessment20":"82","SCHREcontaccessment30":"87","SCHREcaproject0":"81","SCHREcatha0":"89","SCHREcanm0":"82","SCHREexamscores0":"87") to ("SCHREsubject20":"41C44DB","SCHREcontaccessment120":"87","SCHREcontaccessment220":"82","SCHREcontaccessment320":"87","SCHREcaproject20":"81","SCHREcatha20":"89","SCHREcanm20":"82","SCHREexamscores20":"87") Kindly assist {"SCHREsubject0":"41C44DB","SCHREcontaccessment10":"87","SCHREcontaccessment20":"82","SCHREcontaccessment30":"87","SCHREcaproject0":"81","SCHREcatha0":"89","SCHREcanm0":"82","SCHREexamscores0":"87","SCHREsubject1":"2AC20C5","SCHREcontaccessment11":"82","SCHREcontaccessment21":"87","SCHREcontaccessment31":"82","SCHREcaproject1":"89","SCHREcatha1":"81","SCHREcanm1":"87","SCHREexamscores1":"82","SCHREsubject2":"FFF7215","SCHREcontaccessment12":"87","SCHREcontaccessment22":"81","SCHREcontaccessment32":"89","SCHREcaproject2":"82","SCHREcatha2":"87","SCHREcanm2":"82","SCHREexamscores2":"89","SCHREsubject3":"DFC1266","SCHREcontaccessment13":"82","SCHREcontaccessment23":"87","SCHREcontaccessment33":"82","SCHREcaproject3":"89","SCHREcatha3":"82","SCHREcanm3":"87","SCHREexamscores3":"82","SCHREsubject4":"12DE4EA","SCHREcontaccessment14":"81","SCHREcontaccessment24":"87","SCHREcontaccessment34":"82","SCHREcaproject4":"89","SCHREcatha4":"82","SCHREcanm4":"87","SCHREexamscores4":"81"} Answer: Read more
Read More

Updating Android SDK Tools for Eclipse neon 3

java
Question: I've installed ADT via Eclipse 3 neon but when i try to create an Android Project i get this error : enter image description here They say i shoud update the Android SDK from Android Studio but when i tried to update Android SDK via Android Studio i find no updates availables cause i have the 26.0.2 version : enter image description here Thanks Answer: Read more
Read More

Bundler how to uninstall conflicting dependency

ruby
Question: I'm trying to execute vagrant plugin install vagrant-vbguest on my Mac ProductName: Mac OS X ProductVersion: 10.12.6 BuildVersion: 16G29 but I have an error message after that Bundler, the underlying system Vagrant uses to install plugins, reported an error. The error is shown below. These errors are usually caused by misconfigured plugin installations or transient network issues. The error from Bundler is: conflicting dependencies winrm-fs (= 1.0.1) and winrm-fs (= 0.2.3) Activated winrm-fs-0.2.3 which does not match conflicting dependency (= 1.0.1) Conflicting dependency chains: winrm-fs (= 0.2.3), 0.2.3 activated versus: winrm-fs (= 1.0.1) Gems matching winrm-fs (= 1.0.1): winrm-fs-1.0.1 So the question is how to resolve this issue with Bundler of how to just install my guest plugin in a safe manner? Other details vboxmanage --version 5.1.26r117224 Vagrant 1.9.7…
Read More